Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

App does not open on notification click (should "pressAction" be a default without needing to specify it?) #291

@alexanderdavide

Description

@alexanderdavide

Apparent bug

It seems like the app does not open when clicking the notification body.

Environment

react-native: 0.66.4
@notifee/react-native: 4.0.1,
device/api: Pixel_5_API_31

Reproduction steps

  1. npx react-native init repro
  2. npm i @notifee/react-native
  3. add android:exported="true" to AnroidManifest.xml
  4. update build.gradle with compileSdkVersion = 31 targetSdkVersion = 31
  5. add provided code of minimal example
  6. build app
  7. click button to display notification
  8. minimize app and click notification
  9. in my case, the notification disappears after a short moment but the app does not open

minimal example:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import {View, Button} from 'react-native';

import notifee from '@notifee/react-native';

const App = () => {
  async function onDisplayNotification() {
    const channelId = await notifee.createChannel({
      id: 'default',
      name: 'Default Channel',
    });
    await notifee.displayNotification({
      title: 'title',
      body: 'body',
      android: {
        channelId,
        pressAction: {
          id: 'default',
        },
      },
    });
  }

  return (
    <View>
      <Button
        title="Display Notification"
        onPress={() => onDisplayNotification()}
      />
    </View>
  );
};

export default App;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions