-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
iOS Notification Service Extension not getting called #327
Comments
Hey, umm it's hard to say. Someone had something similar before (here) and I suggested the following: _To do a quick debug, leave it the service extension code as self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title]; self.contentHandler(self.bestAttemptContent); This will help determine if the issue is with the setup of the notification service extension or it's something to do with the payload you are sending |
Hey, I've tried that. it still hasn't modified the title. I've even ensured that the NSE is embedded in my main target's "Frameworks, Libs & Embedded Content" section, and included in the build phases. I've even ensured that the signing & provisioning profiles are correct. Either way, I've For anyone else who stumbles upon this, I've also gotten rid of the "notify_options" section and moved it into apns.payload: apns=messaging.APNSConfig(
payload=messaging.APNSPayload(aps=messaging.Aps(mutable_content=1, content_available=1, category="channelHigh", messaging.CriticalSound(
critical=1,
name="ting.wav",
volume=0.2
))
),
), Thanks @helenaford for the PR & contributions to this project! Any idea on when (if) this PR will be merged? |
Any progress with this issue? In my project, I try to set up a payload followed https://notifee.app/react-native/docs/ios/remote-notification-support but it also can not modify and show notification |
In my case the actual notification service extension (NSE) was not firing because of a mismatch of ios targets between the main app and NSE.
|
Thanks a lot. Saved my days. |
I think there is an edit link on each docs page maybe this could be a note on the extension doc, as a PR? |
Closing this as there's a solution above of ensuring the versions match of the nse with your project. Another possible solution as @zenshayan mentions above is to use the |
Hi @helenaford, I am also facing the same. I did follow all the states that are mentioned in Notifee documentation to integrate an NSE from here https://notifee.app/react-native/docs/ios/remote-notification-support. Some Information that might be useful to debug, in Podfile have added this lines of code:
This is the payload that I am passing in rest api for push notification:
I did even checked the console logs of my device, which you can see in the screenshot when getting a Push Notification while App being in background and killed (By User Swiping app) state. In both cases the console logs are same. ![]() Now the thing is that I also faced the same issue (Same console logs) while integrating NSE using firebase messaging (using this doc https://rnfirebase.io/messaging/ios-notification-images), and this issue was resolved by applying this changes mentioned at here invertase/react-native-firebase#7360 (comment), where they indicated that changing some order of build phases resolves that issue and it did do the thing but that is not the case with notifee NSE. Can you please help me with this |
Here's the payload I'm sending from the Firebase Admin SDK (Python)
Here's my NotificationService.m (To debug, I've tried to modify the title of
bestAttemptContent
before sending it to theNotifeeExtensionHelper
)In foreground, notification is handled by RNFirebase's
onMessage()
function. However, in the background or in quit state it just delivers the notification as-is, with no modifications. It doesn't even change the title, which leads me to believe that the NSE isn't getting called at all. Moreover, thesetBackgroundMessageHandler
isn't taking effect either.The only relevant logs I get from Xcode are:
but I'm very clearly setting the backgroundMessageHandler in my entry-level index.js:
Any leads on what could be wrong?
Edit: I upgraded from 4.0.0 to 4.1.0 and RNFirebase from 13 to 14, but background notifications didn't work previously either.
The text was updated successfully, but these errors were encountered: