invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.65k stars 2.21k forks source link

[🐛] How to launch the whole app instead of headless task? #8036

Open ilyagru opened 2 days ago

ilyagru commented 2 days ago

Issue

Describe your issue here

Sorry for creating the issue -- it's just for visibility.

Discussion - https://github.com/invertase/react-native-firebase/discussions/8035


Project Files

Javascript

Click To Expand

#### `package.json`: ```json # N/A ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `e.g. 5.4.3` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N` & `VERSION`


mikehardy commented 2 days ago

if, on android, in response to receiving a notification, you want to launch the whole app

then, it depends on the type of the notification

The headless task stuff is more for silent background notifications where you do not interact with the user but want to do work

If you want to do work, either you post a visible notification (better delivery characteristics / probability anyway) and then on user interaction with that notification the app opens. Or if you really really want it to be like whatsapp or similar you use something like Notifee and do a full-screen notification (assuming your use case is a permitted one, otherwise you will not be approved for the Play Store)