notifly-sdk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -8
- package/package.json +6 -9
package/index.js
CHANGED
|
@@ -83,13 +83,13 @@ exports.initialize = async function (prjId, userName, password) {
|
|
|
83
83
|
try {
|
|
84
84
|
await logEvent("push_delivered", { "campaign_id": campaign_id, "status": "background-notifee" }, null, true);
|
|
85
85
|
} catch (err) {
|
|
86
|
-
console.
|
|
86
|
+
console.warn('[Notifly]: ', err);
|
|
87
87
|
}
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
} catch (err) {
|
|
92
|
-
console.
|
|
92
|
+
console.warn("[Notifly]: ", err);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -118,7 +118,7 @@ exports.foregroundSetting = function () {
|
|
|
118
118
|
}
|
|
119
119
|
await logEvent("push_click", { "campaign_id": campaign_id, "status": "foreground" }, null, true);
|
|
120
120
|
} catch (err) {
|
|
121
|
-
console.
|
|
121
|
+
console.warn('[Notifly]: ', err);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
});
|
|
@@ -144,7 +144,7 @@ async function getCognitoIdToken(userName, password) {
|
|
|
144
144
|
const tokens = JSON.parse(result).AuthenticationResult.IdToken
|
|
145
145
|
return tokens;
|
|
146
146
|
})
|
|
147
|
-
.catch(error => console.
|
|
147
|
+
.catch(error => console.warn('[Notifly]: ', error));
|
|
148
148
|
|
|
149
149
|
return token;
|
|
150
150
|
}
|
|
@@ -252,7 +252,6 @@ async function logEvent(eventName, eventParams, segmentation_event_param_keys =
|
|
|
252
252
|
|
|
253
253
|
const response = await _apiCall("https://12lnng07q2.execute-api.ap-northeast-2.amazonaws.com/prod/records", requestOptions);
|
|
254
254
|
const result = JSON.parse(response)
|
|
255
|
-
console.log(result)
|
|
256
255
|
if (result.message == "The incoming token has expired") {
|
|
257
256
|
const [userName, password] = await Promise.all([AsyncStorage.getItem('notiflyUserName'), AsyncStorage.getItem('notiflyUserPassword')])
|
|
258
257
|
const newToken = await getCognitoIdToken(userName, password);
|
|
@@ -261,9 +260,9 @@ async function logEvent(eventName, eventParams, segmentation_event_param_keys =
|
|
|
261
260
|
}
|
|
262
261
|
|
|
263
262
|
} catch (err) {
|
|
264
|
-
console.
|
|
263
|
+
console.warn('[Notifly]Error: err')
|
|
265
264
|
if (err == 'Error: null value') {
|
|
266
|
-
throw new Error("[Notifly] Fail to log the event.");
|
|
265
|
+
throw new Error("[Notifly] Fail to log the event. Please retry the initialization.");
|
|
267
266
|
}
|
|
268
267
|
}
|
|
269
268
|
}
|
|
@@ -272,4 +271,4 @@ async function _apiCall(apiUrl, requestOptions) {
|
|
|
272
271
|
const result = fetch(apiUrl, requestOptions)
|
|
273
272
|
.then(response => response.text());
|
|
274
273
|
return result;
|
|
275
|
-
}
|
|
274
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notifly-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,15 +9,12 @@
|
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@notifee/react-native": "^7.3.0",
|
|
11
11
|
"@react-native-async-storage/async-storage": "^1.17.11",
|
|
12
|
-
"@react-native-firebase/app": "^16.
|
|
13
|
-
"@react-native-firebase/messaging": "^16.
|
|
14
|
-
"react-native-device-info": "^
|
|
15
|
-
"uuid": "^
|
|
12
|
+
"@react-native-firebase/app": "^16.4.3",
|
|
13
|
+
"@react-native-firebase/messaging": "^16.4.3",
|
|
14
|
+
"react-native-device-info": "^8.1.4",
|
|
15
|
+
"uuid": "^8.3.0"
|
|
16
16
|
},
|
|
17
17
|
"author": "daeseongKim",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"type": "module"
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"notifly-sdk": "^1.0.0"
|
|
22
|
-
}
|
|
19
|
+
"type": "module"
|
|
23
20
|
}
|