apps-sdk 1.0.54 → 1.0.55
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/package.json +2 -1
- package/src/libraries/Networking.js +10 -0
- package/types/index.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apps-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Apps SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@react-native-async-storage/async-storage": "^1.21.0",
|
|
13
|
+
"@react-native-community/netinfo": "^11.3.0",
|
|
13
14
|
"crypto-es": "^2.1.0",
|
|
14
15
|
"expo-constants": "^15.4.5",
|
|
15
16
|
"expo-device": "^5.9.3",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as config from '../../config';
|
|
2
|
+
import NetInfo from "@react-native-community/netinfo";
|
|
2
3
|
import { default as storage } from './Storage';
|
|
3
4
|
import Session from './Session';
|
|
4
5
|
import AdJust from './AdJust';
|
|
@@ -59,6 +60,15 @@ class Networking {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
async checkConnection() {
|
|
64
|
+
try {
|
|
65
|
+
const state = await NetInfo.fetch();
|
|
66
|
+
return state.isConnected;
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error(error);
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
|
|
63
73
|
async request(url, data = {}, encrypt = this.DEFAULT_ENCRYPT_VALUE) {
|
|
64
74
|
data = { ...Session.sessionData, ...data };
|
package/types/index.d.ts
CHANGED
|
@@ -60,7 +60,8 @@ declare module 'apps-sdk' {
|
|
|
60
60
|
getEndpoints(): any;
|
|
61
61
|
setEvents(events: any): void;
|
|
62
62
|
sendEvent(eventType: string, eventKeyword:string, eventData?: object): Promise<void>;
|
|
63
|
-
createSubscription()
|
|
63
|
+
createSubscription();
|
|
64
|
+
checkConnection(): Promise<boolean>;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
export class Storage {
|