How to use addPushTokenListener from Notifications

Please provide the following:

  1. SDK Version: 40.0.1
  2. Platforms(Android/iOS/web/all): Android/iOS

I am trying to understand the usage of the addPushTokenListener listener (Notifications - Expo Documentation) …

It says that I will get a new token, but what I see is a token that looks different than the one I would get from the getExpoPushTokenAsync method … The latter returns a format like ExponentPushToken[abc] but addPushTokenListener returns an object where the data property is a longer random string…

I am using Expo’s push notifications service at https://exp.host/--/api/v2/push/send

Could someone explain what this means?

Thanks in advance

Hi! Great question actually, we should clarify this in the docs. addPushTokenListener is for the device push token. The expoPushToken uses the device push token, and should automatically account for any device push token changes without you having to listen to that yourself. Basically- if you’re using the Expo push service. then you shouldn’t need to worry about this method

and thanks for using the new Tags feature! We just rolled it out yesterday so I hope it becomes more and more helpful

Great! Glad not having to implement this! Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.