File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " pam-react-native" ,
3- "version" : " 0.1.18 " ,
3+ "version" : " 0.1.19 " ,
44 "description" : " Pam SDK for React Native" ,
55 "source" : " ./src/index.tsx" ,
66 "main" : " ./lib/commonjs/index.js" ,
Original file line number Diff line number Diff line change @@ -298,10 +298,24 @@ export class Pam {
298298 return logoutResp ;
299299 }
300300
301+ private static isHex ( str : string ) {
302+ if ( ! str || str === '' ) {
303+ return false ;
304+ }
305+ return / ^ [ 0 - 9 A - F a - f ] + $ / . test ( str ) ;
306+ }
307+
301308 static updatePushNotificationToken ( deviceToken : string ) {
309+ if ( ! deviceToken || deviceToken === '' ) {
310+ return ;
311+ }
312+
313+ // Firebase Token will not Hex
314+ const isFirebaseToken = ! Pam . isHex ( deviceToken ) ;
315+
302316 let mediaKey = '' ;
303317 if ( Platform . OS === 'ios' ) {
304- if ( __DEV__ ) {
318+ if ( ! isFirebaseToken && __DEV__ ) {
305319 deviceToken = `_${ deviceToken } ` ;
306320 }
307321 mediaKey = 'ios_notification' ;
You can’t perform that action at this time.
0 commit comments