Skip to content

Commit 8f04288

Browse files
author
Heart
committed
build: 0.1.19
1 parent fc95fd6 commit 8f04288

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

src/index.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff 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-9A-Fa-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';

0 commit comments

Comments
 (0)