feat: Add push notification support for expo#191
Conversation
6fe35e3 to
b81e919
Compare
b81e919 to
d8231c0
Compare
79fa862 to
cc01598
Compare
|
we're eagerly awaiting this feature! if it would be possible to release a new version with this included in the next few days that would be super appreciated 🙏 |
|
This is Christmas :D For me, we don't need it to use push notifications |
|
@yonitou 👋🏻 |
|
Okay didn't know about that ! Maybe you could add it to the readme so people know why they're adding these new permissions ? (it's not always obvious :D) |
|
I also notice that in this PR, you're saying that there's no "deep links support". What does that mean exactly ?
|
|
@yonitou I'll need to get clarification on that. |
|
Alright :) keep me/us in touch. We'll need these infos to update to the last intercom version (we are currently stuck to v4 with the old config plugin 😅) |
|
Hi @yonitou, Also the following example creates a custom uri. |
|
Hi |
|
Thanks for this feature, the timing on this was perfect for us and our use case! 🙌🏻 Tested on iOS and it works fantastically. However, testing on Android has proved to not be working. Taking a look at this PR, it looks like you have only implemented the config-plugin for iOS and not Android unless I am mistaken? I have run Am I possibly missing something, or is Android support still to come? Thanks! |
|
Similar to @nekode-dev, can confirm that iOS is working great here but so far we've been unable to get push notifications working on Android. @TheNerdGuyLulu is there anything extra we need to do in order to get Android working? |
|
Hi @josh- @nekode-dev 👋🏻 |
|
Hi ! @Br1an-Boyle : except the discussion happening about the Android part (which is quite important for us to use your expo plugin), did you get some clarifications about the do and don't regarding push notfications setup and deep linking (especially for people who come from the old plugin with intercom v4) ? That would be really helpful to get ready and understand what works or not ! |
|
I created a new expo project from scratch. The push notifications works fine for me. For this test I enabled the notifications permission directly from the android settings, but while developing the plugin I used the react-native-permissions and also fine. I'm happy to jump on a call to try to sort it out. |
|
Thanks very much for verifying and the offer to jump on a call @TheNerdGuyLulu, however since we need to support badging the app icon when receiving a notification (and this isn't supported by intercom) we've instead moved to listening to Intercom webhooks and sending our own notifications. |
|
So looks like that this thread can be closed if everything works as expected ? @TheNerdGuyLulu, what about deep links setup in push notifications ? |
|
Hi I'm updating this thread because I still have questions about push notifications and deep link support and especially, the differences between the old plugin and the new one.
Can I have some help/explanations about that ? I carefully read the repository documentation but I don't know if it's exhaustive or not Thanks ! |
|
Hey @yonitou 👋 |
|
I was waiting for your answer before updating my plugin. I can try with your readme but I still don't understand how should I handle deep links ? Is it going to be managed by the |
|
Hey @yonitou As for waiting for the authentication to finish, I don't think we have an interceptor method in our plugin yet but I would have to get back to you on this. Thanks for being patient 😄 |
|
Thx I didn't use any interceptor but I blocked the notification with expo-notifications package, read the data inside and navigated manually instead. It was quite hacky but worked :D |
|
Yes, I think it could but it would be best to test it out first 😄 |
|
I just tried to install the new plugin following the readme :
Any idea ? PS : FYI, I have a working setup for deep links and universal links for Android & iOS with Expo & React Navigation for one year now so I don't think it's related to it. |
|
Here's what I need to do to handle push notifications & deep links the same way for Android & iOS with
I tried on a real iOS device and on an Android simulator. |
|
Up :) |
|
We're running into the same issue as mentioned above by @raffiot. Notifications are working on iOS, but not on Android. Reproducing this issue
Cause of the problemThe cause of this, we've found, is in the payload of the notification that's being sent by Intercom. We were able to troubleshoot this by logging the incoming notifications: Looking at these logs, we noticed the We found the SolutionFrom our investigation we found that the notifications sent from Intercom (specifically for Android) are sent as data-only notifications. These will be delivered silently. For this to work as expected, Intercom will need to make a change in their backend in order to send notification-type notifications. This can be simply done by repeating the content (body) inside of the Pinging @Br1an-Boyle @uddish: Could you confirm this is indeed an issue? And if so, chance you can bring this up internally? Further reading: |
|
Thanks a lot @edwinw6 for this awesome message digging into it! 🤩 I shared it with the customer support and this is their response
So I imagine we won't hear from them for some time for such an important feature as push notification... I'll let you know when I have more informations from them. |
|
Great! Perhaps if we all raise this issue with their customer support, we can get this prioritised. |
|
Hey |
|
I face the same issue with push notifications on Android. The problem occurs when the app is in a quit state; the notification is not shown at all. In the background state, notifications are caught by firebase.messaging().onMessage, but when the app is closed, nothing happens. From the adb logs, I see this error: W ActivityManager: Background start not allowed: service Intent { cmp=xxx.xxx.app.dev/io.invertase.firebase.messaging.ReactNativeFirebaseMessagingHeadlessService (has extras) } to xxx.xxx.app.dev/io.invertase.firebase.messaging.ReactNativeFirebaseMessagingHeadlessService from pid=9775 uid=10211 pkg=xxx.xxx.app.dev startFg?=false This seems related to Android's restrictions on starting background services. T |
Hello @raffiot have you had any update about this issue since the last time? |
|
hi any updates on this? |
|
Hello @edwinw6, Have you been able to find a solution to get push notifications working on Android when the app is in a quit state? From my side, I’ve been in contact with Intercom support, but I’m not sure they understood that the issue doesn’t seem to be with the SDK for Expo itself, but rather with the content of the push notifications. I’m also quite surprised that this issue hasn’t gained more traction—it feels rather silent. I wonder if it’s working properly for other people using Expo. Let me know if you’ve made any progress! Best regards, |
|
Hey @olarra, We have not been able to find a reliable workaround that also works when the app is in a quit state. I've asked Intercom support for an update on this, hoping that they'll be able to prioritise this issue. If anyone is able to make this work on Android reliably, we'd love to hear! |
|
For me, the package does not handle deeplinks correctly for mobile push notifications on iOS using Expo. The added deeplink is not triggered and the app is opened but does not navigate to the link. I do receive the notifications. I can confirm that the PN object contains the deeplink as uri in I have set up as described: and have a working (deep) linking setup that I can test with npx uri-scheme. For now, I do have a working workaround with a custom hook that listens to incoming push notifications (or gets the last one on cold boot) and opens the url: I would however expect that my changes in Note also how intercom documentation mentions that push notifications are not yet supported by this package 🤷 Does anyone else experience this issue? Or did anyone had this issue but managed to fix it using the changes in |
|
@uddish do you know if the push notifications and deep links issue has been resolved for the Expo Plugin in the New architecture ? |
|
@yonitou and anyone else trying to get Push Notifications working well on Android with Expo - I've opened a ticket on the community support site at https://community.intercom.com/mobile-sdks-24/android-push-notification-handling-in-expo-expo-notifications-12797 👀 |
The Expo config plugin already automated iOS push notification setup (PR #191) but Android was left out, requiring developers to manually create a FirebaseMessagingService and edit native files — defeating the purpose of using Expo. This adds the Android counterpart: a config plugin that generates a Kotlin FirebaseMessagingService at prebuild time, registers it in the AndroidManifest, and routes Intercom pushes to the SDK while passing non-Intercom messages through to other handlers (e.g. expo-notifications). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Why?
Towards https://github.com/intercom/intercom/issues/328801