react-native-idosdk 1.0.0 → 1.0.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.d.ts
CHANGED
|
@@ -14,11 +14,14 @@ export default class GetuiIdo {
|
|
|
14
14
|
static setSessionTime(time: number): void;
|
|
15
15
|
|
|
16
16
|
static setMinAppActiveDuration(val: number);
|
|
17
|
+
static setMaxAppActiveDuration(val: number);
|
|
17
18
|
|
|
18
19
|
static setEventUploadInterval(val: number);
|
|
19
20
|
static setEventForceUploadSize(val: number);
|
|
21
|
+
|
|
20
22
|
static setProfileUploadInterval(val: number);
|
|
21
23
|
static setProfileForceUploadSize(val: number);
|
|
24
|
+
|
|
22
25
|
static setUserId(val: string);
|
|
23
26
|
static setSyncGenerateGtcid(val: boolean);
|
|
24
27
|
static registerEventProperties(val: Map);
|
package/index.js
CHANGED
|
@@ -10,40 +10,10 @@ const GetuiIdoModule = NativeModules.GetuiIdoModule;
|
|
|
10
10
|
* @param {string} message
|
|
11
11
|
*/
|
|
12
12
|
const log = (message) => {
|
|
13
|
-
console.log(`[Getui] ${message}`);
|
|
13
|
+
console.log(`[Getui][Ido] ${message}`);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export default class
|
|
17
|
-
//监听消息通知
|
|
18
|
-
// var { NativeAppEventEmitter } = require('react-native');
|
|
19
|
-
// var receiveRemoteNotificationSub = NativeAppEventEmitter.addListener(
|
|
20
|
-
// 'receiveRemoteNotification',
|
|
21
|
-
// (notification) => {
|
|
22
|
-
// //消息类型分为 APNs 和 payload 透传消息,具体的消息体格式会有差异
|
|
23
|
-
// switch (notification.type) {
|
|
24
|
-
// case "apns":
|
|
25
|
-
// Alert.alert('APNs 消息通知',JSON.stringify(notification))
|
|
26
|
-
// break;
|
|
27
|
-
// case "payload":
|
|
28
|
-
// Alert.alert('payload 消息通知',JSON.stringify(notification))
|
|
29
|
-
// break;
|
|
30
|
-
// default:
|
|
31
|
-
// }
|
|
32
|
-
// }
|
|
33
|
-
// );
|
|
34
|
-
//
|
|
35
|
-
// var clickRemoteNotificationSub = NativeAppEventEmitter.addListener(
|
|
36
|
-
// 'clickRemoteNotification',
|
|
37
|
-
// (notification) => {
|
|
38
|
-
// Alert.alert('点击通知',JSON.stringify(notification))
|
|
39
|
-
// }
|
|
40
|
-
// );
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
// //记得在 componentWillUnMount 移除监听
|
|
44
|
-
// receiveRemoteNotificationSub.remove()
|
|
45
|
-
// clickRemoteNotificationSub.remove()
|
|
46
|
-
|
|
16
|
+
export default class GetuiIdo {
|
|
47
17
|
/**
|
|
48
18
|
* 初始化推送服务 只有Android, IOS在AppDelegate中初始化
|
|
49
19
|
*/
|
|
@@ -81,6 +51,9 @@ export default class Getui {
|
|
|
81
51
|
static setMinAppActiveDuration(val) {
|
|
82
52
|
GetuiIdoModule.setMinAppActiveDuration(val);
|
|
83
53
|
}
|
|
54
|
+
static setMaxAppActiveDuration(val) {
|
|
55
|
+
GetuiIdoModule.setMaxAppActiveDuration(val);
|
|
56
|
+
}
|
|
84
57
|
|
|
85
58
|
static setEventUploadInterval(val) {
|
|
86
59
|
GetuiIdoModule.setEventUploadInterval(val);
|
|
@@ -141,7 +141,7 @@ RCT_EXPORT_MODULE();
|
|
|
141
141
|
//MARK: - GTCountSDKDelegate
|
|
142
142
|
|
|
143
143
|
- (void)GTCountSDKDidReceiveGtcid:(NSString *)gtcid error:(NSError *)error {
|
|
144
|
-
NSLog(@"IDOSDK>>>GTCountSDKDidReceiveGtcid %@",
|
|
144
|
+
NSLog(@"IDOSDK>>>GTCountSDKDidReceiveGtcid %@",gtcid);
|
|
145
145
|
[self getui_sendAppEventWithName:@"GTCountSDKDidReceiveGtcid"
|
|
146
146
|
body:gtcid];
|
|
147
147
|
}
|
|
@@ -153,7 +153,7 @@ RCT_EXPORT_MODULE();
|
|
|
153
153
|
/**
|
|
154
154
|
* 销毁SDK,并且释放资源
|
|
155
155
|
*/
|
|
156
|
-
RCT_EXPORT_METHOD(
|
|
156
|
+
RCT_EXPORT_METHOD(startSdk:(NSString *)appId withChannelId:(NSString *)channelId)
|
|
157
157
|
{
|
|
158
158
|
|
|
159
159
|
NSLog(@"IDOSDK>>>startSDKWithAppId %@ %@", appId, channelId);
|
|
@@ -190,7 +190,7 @@ RCT_EXPORT_METHOD(setApplicationGroupIdentifier:(NSString*)identifier)
|
|
|
190
190
|
RCT_EXPORT_METHOD(setSessionTime:(NSInteger)sessionTime)
|
|
191
191
|
{
|
|
192
192
|
NSLog(@"IDOSDK>>>setSessionTime %@", @(sessionTime));
|
|
193
|
-
[GTCountSDK sharedInstance].sessionTime =
|
|
193
|
+
[GTCountSDK sharedInstance].sessionTime = sessionTime;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
RCT_EXPORT_METHOD(setMinAppActiveDuration:(NSInteger)minAppActiveDuration)
|
|
@@ -237,13 +237,13 @@ RCT_EXPORT_METHOD(setUserId:(NSString*)userId)
|
|
|
237
237
|
|
|
238
238
|
RCT_EXPORT_METHOD(setSyncGenerateGtcid:(BOOL)syncGenerateGtcid)
|
|
239
239
|
{
|
|
240
|
-
NSLog(@"IDOSDK>>>setSyncGenerateGtcid %@", syncGenerateGtcid);
|
|
240
|
+
NSLog(@"IDOSDK>>>setSyncGenerateGtcid %@", @(syncGenerateGtcid));
|
|
241
241
|
[GTCountSDK sharedInstance].syncGenerateGtcid = syncGenerateGtcid;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
RCT_EXPORT_METHOD(registerEventProperties:(NSDictionary*)properties)
|
|
245
245
|
{
|
|
246
|
-
NSLog(@"IDOSDK>>>registerEventProperties %@",
|
|
246
|
+
NSLog(@"IDOSDK>>>registerEventProperties %@", properties);
|
|
247
247
|
[GTCountSDK registerEventProperties:properties];
|
|
248
248
|
}
|
|
249
249
|
|