File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " pam-react-native" ,
3
- "version" : " 0.1.18 " ,
3
+ "version" : " 0.1.19 " ,
4
4
"description" : " Pam SDK for React Native" ,
5
5
"source" : " ./src/index.tsx" ,
6
6
"main" : " ./lib/commonjs/index.js" ,
Original file line number Diff line number Diff line change @@ -298,10 +298,24 @@ export class Pam {
298
298
return logoutResp ;
299
299
}
300
300
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
+
301
308
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
+
302
316
let mediaKey = '' ;
303
317
if ( Platform . OS === 'ios' ) {
304
- if ( __DEV__ ) {
318
+ if ( ! isFirebaseToken && __DEV__ ) {
305
319
deviceToken = `_${ deviceToken } ` ;
306
320
}
307
321
mediaKey = 'ios_notification' ;
You can’t perform that action at this time.
0 commit comments