Closed AleksandrTermenzhy closed 1 week ago
Hi @AleksandrTermenzhy. Thanks for reaching out and sharing the details. Sorry to hear about the issue you're facing. This is probably similar to the one reported on Expo? If yes, we are aware of it and do have plans to improve experience for such use cases. While the fix might not be available very soon, there is a workaround that should help you solve the issue.
To make it work, you need to follow these steps:
MessagingPushAPN.initialize
and disable auto registering of device tokens as follows:MessagingPushAPN.initialize { config in
config.autoFetchDeviceToken = false
}
AppDelegate
and MyAppPushNotificationsHandler
to match the implementation required before auto device token feature was released. I can help you find some relevant code using git history from our sample apps for AppDelegate
and MyAppPushNotificationsHandler
files.Let me know if this doesn't solve the issue or if you have more questions. Have a great day.
Hey @mrehan27
Thanks for quick reply. Can you provide more details on what changes to AppDelegate
and MyAppPushNotificationsHandler
exactly should I be looking at? Cause that code is for pre-0.73 RN version.
Also, should adding config.autoFetchDeviceToken = false
only work in my case?
Sorry if this has caused any confusion @AleksandrTermenzhy. I checked with team to confirm, and you don't need to make other changes. Only disabling auto-fetching of token by adding following code in setupCustomerIOClickHandling
of CustomerIOPushNotificationsHandler
should work for you:
MessagingPushAPN.initialize { config in
config.autoFetchDeviceToken = false
}
Do let us know if this solves the problem for you or not. We can dive deeper and help if this doesn't fix the problem for you. Please feel free to ask any more questions you have. Have a great day.
Setting config.autoFetchDeviceToken = false
seems to have fixed that issue for me. At least, the app registers successfully with Amplify now.
I think we may close this issue for now.
Thanks for your help @mrehan27 !
Thanks for the confirmation @AleksandrTermenzhy. Glad it worked out. Happy to help!
SDK version: 3.7.2 React Native version: 0.73.8
Are logs available?
No
Describe the issue In our app we use AWS Amplify for sending push notifications. But it fails to work when used alongside with Customer.IO SDK. Essentially, it seems that the app never registers for push notifications. The main reason seems to be due to this line:
Commenting this line allows for the app to work as expected and push notifications to arrive successfully. However, I assume it might cause some issue with tracking metrics for CustomerIO side.
I'll appreciate any thoughts on how to fix this.
-- Here is AppDelegate.mm and notifications handler for reference: