-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fetch currently stored device token using JS method #216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and tested as well.
## [3.3.0](3.2.1...3.3.0) (2023-11-01) ### Features * fetch currently stored device token using JS method ([#216](#216)) ([482f780](482f780))
if (deviceToken != null) { | ||
promise.resolve(deviceToken) | ||
} else { | ||
promise.reject("device_token_not_found", "The device token is not available.") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred to have the Promise resolve null instead of reject when the native device token is null.
A device not yet having a device token is not an error, IMO.
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:
How to test this feature?