-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[🐛] 🔥 getAPNSToken applies uppercase to token #8022
Comments
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
Can I get an update on this? It's still an unanswered question for our team. |
Hmm https://github.com/search?q=repo%3Ainvertase%2Freact-native-firebase%20apnstoken&type=code react-native-firebase/packages/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m Line 24 in 9c94085
I appear to have done that in a method used during the setAPNSToken call chain when I implemented token / APNS support for emulators 8d75b36#diff-97d5c046fba96de49ba4b86103474a551a097bf5f8bff88fd7de30c20b0fa624R23 if they are not case sensitive on the APNS side then perhaps they should be normalized prior to your device/token mapping storage and/or de-duplicated now? Either upper or lower case appears to be valid though I'll admit it seems upper case seems more correct Not sure how or if this should rectified at this point (people may depend on the current behavior?), but I'm open to suggestion and/or PRs (maybe a rename / deprecate of the API that does current behavior, and alter all other APNS token handling to be all upper case to match firebase-ios-sdk / iOS native APIs ? as a breaking change?) |
I do think it'd be nice to get the token back in the unmodified state if possible - there definitely isn't a ton of the documentation for case sensitivity in these tokens but our team did find this that suggests we should only be sending back the |
Issue
We're having an issue when using the
getAPNSToken
function in the messaging package where the hex string returned is uppercased, but the value returned from APNS contains lowercased values.In our project we have the following:
which will print us out a device token that has all-uppercase characters. When I modify the
ios
AppDelegate
file to log the device hex token, I see that all characters are lower case:from the generated AppDelegate
This is an issue for us since the token code is not case sensitive on the APNS-side, so if you were to send out notifications to that token as an uppercase and lowercase string the user would get that notification twice. Was there a change added that could have updated the formatting of the token?
Project Files
Javascript
Click To Expand
package.json
:# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:18.8.0
Firebase
module(s) you're using that has the issue:messenger, app
TypeScript
?Y
&5.0.4
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: