reactnative-plugin-appice 1.7.19 → 1.7.21

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DeviceEventEmitter, NativeEventEmitter, NativeModules } from 'react-native';
2
- import { Platform, Component } from 'react-native';
2
+ import { Platform, Component, AppState } from 'react-native';
3
3
  // import { MMKV } from 'react-native-mmkv'
4
4
  import AsyncStorage from '@react-native-async-storage/async-storage';
5
5
  import Campaign from './campaign';
@@ -165,6 +165,15 @@ var AppICEReact = {
165
165
  AppIceReactPlugin.startContext(appID, appKey, apiKey, deviceID, region, baseUrl, certs)
166
166
  }
167
167
  });
168
+ AppState.addEventListener('change', (nextAppState) => {
169
+ if (nextAppState === 'active') {
170
+ AppIceReactPlugin.isDeviceReady(true);
171
+ AppIceReactPlugin.registerLifeCycle();
172
+ } else if (nextAppState === 'background') {
173
+ AppIceReactPlugin.isDeviceReady(false);
174
+ AppIceReactPlugin.registerLifeCycle();
175
+ }
176
+ });
168
177
  },
169
178
 
170
179
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactnative-plugin-appice",
3
- "version": "1.7.19",
3
+ "version": "1.7.21",
4
4
  "description": "appICE React Native SDK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -8,6 +8,7 @@
8
8
  "example",
9
9
  "android",
10
10
  "index.js",
11
+ "campaign.js",
11
12
  "ios",
12
13
  "reactnative-plugin-appice.podspec"
13
14
  ],
File without changes