customerio / customerio-expo-plugin

MIT License
11 stars 9 forks source link

[Question] Getting Rich Push Notifications to work alongside Live Activities with Expo managed app #158

Closed carozo closed 37 minutes ago

carozo commented 6 days ago

New question:

Does our SDK's rich push notification NSE target work alongside Live Activities? How can they set this up? (possible docs update needed)

Previous queston:

We are using expo-notifications to send some notifications and the customerio sdk to send others. The issue we're having is that Expo is handling all the notifications (even customerio ones) and that prevents rich push notifications from working. I have followed this guide and I was able to get the rich push notification to show up when the app is in foreground, but I can't seem to make it work in the background.

I see that in the docs there's a section dedicated to setup the background listeners using firebase's setBackgroundMessageHandler, and I tried a similar approach using expo-notifications:

TaskManager.defineTask(BACKGROUND_NOTIFICATION_TASK, async ({ data }) => {
  await CustomerIO.pushMessaging()
    .onBackgroundMessageReceived(data)
    .then(handled => {
      if (!handled) {
        console.log('Notification not handled by Customer.io')
      }
    })
})

but that always logs 'Notification not handled by Customer.io', even if it was a customerio push notification. This is happening to me in iOS as well. Any help would be greatly appreciated. Thanks!

carozo commented 6 days ago

Closing this because I found the issue. I was passing the wrong object to onBackgroundMessageReceived, should have passed data.notification

jordanhailey commented 2 hours ago

Troubleshooting has continued within a support conversation. Closing this issue as it appears the problem is related to Live Activities.