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.71k stars 2.22k forks source link

Ios Background Message Handler doesn't work with firebase console message #6896

Closed ahmedelsayed11 closed 1 year ago

ahmedelsayed11 commented 1 year ago

What i am facing?

I need to save the incoming notifications locally in an offline database and notification will be send from firebase console not from the sdk or postman. The issue is the setBackgroundMessageHandler doesn't work when the app in the background or killed. Note, i managed to make it work when sending a message from postman and here is my body: { "message": { "apns": { "payload": { "aps": { "content-available": 1 }, "acme1": "bar", "acme2": "42" }, "headers": { "apns-priority": "5" } }, "token":"<your-token>", "notification": { "title": "Mumbai vs Pune finals", "body": "Watch the match online now" }, "data":{ "notificationType":"offer" } } }

mikehardy commented 1 year ago

Your goals are not achievable, you won't be able to accomplish this with the console I don't think. Plan on using firebase functions and the firebase-admin-sdk in combination with device tokens.

mingyeom1 commented 1 year ago

me too. please save me!!!

ahmedelsayed11 commented 1 year ago

I managed to do it in swift but as @mikehardy said it's not achievable with firebase console. But you can communicate with me on my email a7medelsayed087@gmail.com

github-actions[bot] commented 1 year ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

KumailAhmedWellwink commented 1 year ago

i am using the latest @react-native-firebase/app :17.4.0 , @react-native-firebase/messaging :17.4.0

my podfile file pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app' pod 'RNFBMessaging', :path => '../node_modules/@react-native-firebase/messaging'

my React Native version is react-native": "^0.65.0" calling messaging().SetBackgroundmessagehandler() in index.js

also enable in background Modes complete follow the documentation and doing all the steps but still no luck

github-actions[bot] commented 1 year ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.