notifly-sdk 1.0.9 → 1.1.1
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 +1 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -41,11 +41,7 @@ async function _sessionStart() {
|
|
|
41
41
|
await logEvent("session_start", openAppEventParams, null, true)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
exports.initialize = function (prjId, userName, password) {
|
|
45
|
-
_initialize(prjId, userName, password);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async function _initialize(prjId, userName, password) {
|
|
44
|
+
exports.initialize = async function (prjId, userName, password) {
|
|
49
45
|
try {
|
|
50
46
|
await messaging().requestPermission();
|
|
51
47
|
|
|
@@ -76,9 +72,7 @@ async function _initialize(prjId, userName, password) {
|
|
|
76
72
|
AsyncStorage.setItem('notiflyUserName', userName),
|
|
77
73
|
AsyncStorage.setItem('notiflyUserPassword', password),
|
|
78
74
|
])
|
|
79
|
-
|
|
80
75
|
await _sessionStart();
|
|
81
|
-
|
|
82
76
|
} catch (err) {
|
|
83
77
|
console.warn("[Notifly]: ", err);
|
|
84
78
|
}
|
|
@@ -234,7 +228,6 @@ async function logEvent(eventName, eventParams, segmentation_event_param_keys =
|
|
|
234
228
|
|
|
235
229
|
const response = await _apiCall("https://12lnng07q2.execute-api.ap-northeast-2.amazonaws.com/prod/records", requestOptions);
|
|
236
230
|
const result = JSON.parse(response)
|
|
237
|
-
console.log('api', result)
|
|
238
231
|
if (result.message == "The incoming token has expired") {
|
|
239
232
|
const [userName, password] = await Promise.all([AsyncStorage.getItem('notiflyUserName'), AsyncStorage.getItem('notiflyUserPassword')])
|
|
240
233
|
const newToken = await getCognitoIdToken(userName, password);
|