-
Notifications
You must be signed in to change notification settings - Fork 132
OnMessage not fired when app is in background - IOS #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You shouldn't need any of that notifications stuff in your app delegate if you are using the C++ SDK. The SDK uses swizzling to hook into those notifiers directly. Could you see if you are able to reproduce the issue using the C++ quick start? (this GitHub project). And also if you remove all of the notifications-related code from your app delegate. |
@tezine Just to follow-up. Are you able to resolve your issue? |
@tezine the message is not received in the background on iOS until the user taps on the message in the notification tray (see https://firebase.google.com/docs/cloud-messaging/ios/receive#handle_messages_received_through_the_apns_interface ). iOS doesn't really let you run your whole application in the background for a long time like Android. We're likely to add support for iOS extensions for Cloud Messaging to allow you to take action when a message is received like customization of the notification or caching, but that's all we can do I'm afraid. As @jonsimantov and @chkuang-g mentioned, you don't need any custom AppDelegate code in the C++ SDK, we hook everything for you. If you follow the sample code (in this repo) you'll see what you need. |
Hi,
Firebase C++ is working great on Android, but I'm facing some issues with IOS.
I'm sending a data message to one iOS Device like this:
The message above fires the C++ OnMessage when the iOS app is in foreground, but it's not received when it's in background.
Any ideas on how to make it work and also display a notification when a message is received in background?
Here's my AppDelegate.m:
I'm using Firebase CPP 5.4.4
Thank you,
Bruno.
The text was updated successfully, but these errors were encountered: