Closed TwistedMinda closed 1 month ago
Hey, @TwistedMinda thank you for the detailed explanation here, it is very helpful.
Okay, so I understand the issue and I have been thinking about the possible solutions here, I could come up with 4 and you can weigh your pros and cons.
Custom Expo Plugin: You could create a custom Expo plugin that adds the necessary native code to handle both CustomerIO and Intercom notifications. This would involve creating a plugin similar to your React Native implementation, which overrides the FirebaseMessagingService. This should resolve your issue the same way, you are resolving right now.
Keep using React native Intercom doesn't officially support Expo, we are working toward adding more customization and features in Expo but they are in the pipeline. So it might make sense to stick with react native until Expo is adopted by Intercom as well?
Callbacks We don't have this feature yet, but we do plan to give support for callbacks, that way when you get the push notification, in the callback you would be able to do whatever you want, including calling a method of Intercom, etc. But the issue is, we don't have any current timeline as to when callback would be introduced, second these callbacks would be in JS/TS so not sure, how that could help invoke intercom methods as they are native-based.
Use a 3rd party SDK
Our plugin is fully compatible with expo-notification
and rn-firebase
. So you could use one of them and call our methods using their callbacks. Here is an example of how you could call our SDK methods from rnfirebase
. I am not sure if Intercom provides this support, but if it does, you could just use this approach and call methods of both CustomerIO and Intercom.
My recommendation would be to either keep using react native or create a custom plugin for now, until Intercom adds more support/customization with expo or JS methods.
Hello, thank you for your very fast response!
Okay those 4 options are also the ones I had in mind.
Custom Expo Plugin: This solution doesn't seem viable for us as this just adds a lot of complexity and maintenance to something that was supposed to become simpler when going to Expo (not having to deal with native files), and is already working on our current setup. Of course, if someone in the community creates it, we would be happy to use it!
Keep using react-native: This was and is probably going to be our go-to until there is a cleaner and simpler way to setup Expo without having to deal with native files.
Callbacks: That would be a clean way to fix the problem but I think Intercom might need to make some changes because there is no exposed JS function to delegate a notification for Intercom to display it, as of now.
Use a 3rd party SDK: Same for Callbacks solution, the only possible way seem to display the Intercom notification with their logic is to dispatch the notification right from the FirebaseMessagingService, so won't fit Intercom JS implementation.
So again, I believe we can wait further in order to make a smoother transition to Expo and not have to deal with native files. It is good to know that this should be available at some point.
I think I might also post this to Intercom Developer Forum to see what they think about it!
Thanks again for your quick response
Awesome, makes sense. Closing this now, feel free to re-open or create another ticket if you have any more questions.
Hello, We have an issue when using Expo + CustomerIO + Intercom for notifications, on Android. We don't receive notifications from Intercom after installing CustomerIO. On iOS, everything works fine, we receive notifications from CustomerIO as well as from Intercom without any issue.
SDK version:
Environment: Android only
Are logs available? No logs available
Describe the bug Push notifications are not received from Intercom after installing CIO SDK.
To Reproduce
app.config.ts
)app.config.ts
)Expected behavior We would expect to be able to receive both CIO and Intercom notifications.
Additional context For context, we already have the setup CustomerIO + Intercom and receiving notifications from both, in our react-native setup (without Expo). The problem appears when we try to migrate to Expo. Initially, the problem is the same on React-Native, and we had to override the
FirebaseMessagingService
to make it work, dispatching in both cases depending on Intercom or CustomerIO, see below.Modifying the native files when using Expo becomes very complicated (using the custom plugins) and it doesn't seem worth to migrate to Expo if we still need to manage this kind of native issues.
Is there a way for you to handle this on the CustomerIO side directly? Or maybe do we need to ask to Intercom if they could do it? I am really not sure who has to take action for this setup "Expo + CustomerIO + Intercom" to work gracefully.
This is the last step preventing us to fully migrate to Expo, so I'm really looking forward for a solution on this. Maybe someone already has a plugin that would create the
FirebaseMessagingService
just like in a react-native setup?Thank you very much