customerio / customerio-reactnative

MIT License
23 stars 11 forks source link

feat: fetch currently stored device token using JS method #216

Closed ami-aman closed 9 months ago

ami-aman commented 9 months ago

Closes: https://github.com/customerio/issues/issues/11181

Provides a feature to fetch currently stored device token and returns as a string in a promise. This feature helps getting device tokens for FCM & APN for iOS and FCM token for Android. The following is the use case of the feature:

   CustomerIO.pushMessaging()
      .getRegisteredDeviceToken()
      .then((token) => {
        setDeviceToken(token);
      })
      .catch((error) => {
        console.log(error);
   });

How to test this feature?