react-native-idosdk 1.0.0
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/IdoSdkRN.podspec +27 -0
- package/README.md +96 -0
- package/android/build.gradle +57 -0
- package/android/libs/getui-3.3.11.0.jar +0 -0
- package/android/libs/gtc-3.2.18.0.jar +0 -0
- package/android/proguard.txt +37 -0
- package/android/src/main/AndroidManifest.xml +100 -0
- package/android/src/main/java/com/getui/reactnativegetui/DemoPushService.java +7 -0
- package/android/src/main/java/com/getui/reactnativegetui/GetuiLogger.java +26 -0
- package/android/src/main/java/com/getui/reactnativegetui/GetuiModule.java +346 -0
- package/android/src/main/java/com/getui/reactnativegetui/GetuiPackage.java +42 -0
- package/android/src/main/java/com/getui/reactnativegetui/PushIntentService.java +110 -0
- package/document/android.md +112 -0
- package/document/iOS.md +299 -0
- package/document/img/ios_1.jpeg +0 -0
- package/gradlew +160 -0
- package/gradlew.bat +90 -0
- package/index.d.ts +32 -0
- package/index.js +120 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/Info.plist +55 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/_CodeSignature/CodeResources +548 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/GTCountSDK +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/Headers/GTCountSDK.h +145 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/Info.plist +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/Modules/module.modulemap +5 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/PrivacyInfo.xcprivacy +44 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/_CodeSignature/CodeResources +147 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64/GTCountSDK.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/GTCountSDK +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/Headers/GTCountSDK.h +145 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/Info.plist +52 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/Modules/module.modulemap +5 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/PrivacyInfo.xcprivacy +44 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/_CodeSignature/CodeResources +147 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-maccatalyst/GTCountSDK.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/GTCountSDK +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/Headers/GTCountSDK.h +145 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/Info.plist +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/Modules/module.modulemap +5 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/PrivacyInfo.xcprivacy +44 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/_CodeSignature/CodeResources +147 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/GTCountSDK.xcframework/ios-arm64_x86_64-simulator/GTCountSDK.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/RCTGetuiIdoModule.h +23 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule/RCTGetuiIdoModule.m +279 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule.xcodeproj/project.pbxproj +288 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RCTGetuiIdoModule/RCTGetuiIdoModule.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/package.json +55 -0
- package/postInstall.js +79 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GTCountSDK.h
|
|
3
|
+
// GTCountSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by GeTui on 2017/7/18.
|
|
6
|
+
// Copyright © 2017年 GeTui. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
// Version : GSIDO-IOS-2.0.9.0
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@protocol GTCountSDKDelegate <NSObject>
|
|
14
|
+
|
|
15
|
+
@optional
|
|
16
|
+
- (void)GTCountSDKDidReceiveGtcid:(NSString *)gtcid error:(NSError*)error;
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@interface GTCountSDK : NSObject
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
设置会话时长(默认 30000 ms,单位毫秒),在应用退到后台后停留时间超过会话时长,视为一次新的应用会话。
|
|
24
|
+
*/
|
|
25
|
+
@property (nonatomic, assign) NSInteger sessionTime;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
设置有效活跃时长,活跃时长满足[min, max]的才会上报服务器记录
|
|
29
|
+
minAppActiveDuration默认 0 ms, maxAppActiveDuration默认 12*3600*1000 ms, 单位毫秒
|
|
30
|
+
*/
|
|
31
|
+
@property (nonatomic, assign) NSInteger minAppActiveDuration;
|
|
32
|
+
@property (nonatomic, assign) NSInteger maxAppActiveDuration;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
// 累计条数到达ForceUploadSize 或 距离上一次汇报时间间隔超过UploadInterval后,将触发上传流程
|
|
36
|
+
|
|
37
|
+
// trackCustomKeyValueEvent和trackCountEvent的上报间隔, 默认10000毫秒,即10秒。
|
|
38
|
+
// 传入的参数如果小于默认值,则按照默认值生效。
|
|
39
|
+
@property (nonatomic, assign) NSInteger eventUploadInterval;
|
|
40
|
+
|
|
41
|
+
// trackCustomKeyValueEvent和trackCountEvent 的上报条数阈值,默认30
|
|
42
|
+
@property (nonatomic, assign) NSInteger eventForceUploadSize;
|
|
43
|
+
|
|
44
|
+
// Profile上报间隔, 默认5000毫秒,即5秒
|
|
45
|
+
// 传入的参数如果小于默认值,则按照默认值生效。
|
|
46
|
+
@property (nonatomic, assign) NSInteger profileUploadInterval;
|
|
47
|
+
|
|
48
|
+
// Profile上报条数阈值,默认5
|
|
49
|
+
@property (nonatomic, assign) NSInteger profileForceUploadSize;
|
|
50
|
+
|
|
51
|
+
// 设置用户id
|
|
52
|
+
@property (nonatomic, copy) NSString *userId;
|
|
53
|
+
|
|
54
|
+
// 同步生成gtcid, 默认NO:异步生成,初始化sdk后,直接可获取gtcid, YES:同步生成,首次安装后需要等待服务端响应后才能获取gtcid
|
|
55
|
+
// add at 2.0.7.0
|
|
56
|
+
@property (nonatomic, assign) BOOL syncGenerateGtcid;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
SDK 实例,用于获取和设置 SDK 相关配置属性。
|
|
60
|
+
示例,设置上报策略:[[GTCountSDK sharedInstance] setSessionTime:30*1000];
|
|
61
|
+
*/
|
|
62
|
+
+ (instancetype)sharedInstance;
|
|
63
|
+
|
|
64
|
+
/// gtcid可用于用户画像标签的查询。
|
|
65
|
+
+ (NSString*)gtcid;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 设置 App Groups Id (如有使用 iOS Extension SDK,请设置该值)
|
|
69
|
+
*/
|
|
70
|
+
+ (void)setApplicationGroupIdentifier:(NSString*)identifier;
|
|
71
|
+
|
|
72
|
+
/// 注册事件公共属性
|
|
73
|
+
/// @param properties 属性字典, value 仅支持NSNumber, NSString, NSDate 4 种类型。
|
|
74
|
+
+ (void)registerEventProperties:(NSDictionary*)properties;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
初始化启动接口
|
|
78
|
+
|
|
79
|
+
@param appId 开发者后台生成的 appId
|
|
80
|
+
@param channelId 渠道名称,默认为 'appstore'
|
|
81
|
+
@param delegate delegate
|
|
82
|
+
*/
|
|
83
|
+
+ (void)startSDKWithAppId:(NSString *)appId withChannelId:(NSString *)channelId delegate:(id<GTCountSDKDelegate>)delegate;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
记录自定义事件的开始
|
|
87
|
+
注意:需要跟 trackCustomKeyValueEventEnd:withArgs: 配对使用
|
|
88
|
+
若多次调用则以最后一次开始的时间为准
|
|
89
|
+
|
|
90
|
+
@param eventId 自定义事件 Id,需要在个数后台配置才能生效
|
|
91
|
+
*/
|
|
92
|
+
+ (void)trackCustomKeyValueEventBegin:(NSString *)eventId;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
记录自定义事件的结束
|
|
96
|
+
注意:需要跟 trackCustomKeyValueEventBegin:withArgs: 配对使用
|
|
97
|
+
若多次调用则以第一次结束的时间为准
|
|
98
|
+
|
|
99
|
+
@param eventId 自定义事件 Id,需要在个数后台配置才能生效
|
|
100
|
+
@param args 自定义属性,key 必须为 NSString 类型(注意:不能以$开头),value 仅支持NSNumber, BOOL, NSString, NSDate 4 种类型。
|
|
101
|
+
@param ext 自定义ext字段内容。
|
|
102
|
+
*/
|
|
103
|
+
+ (void)trackCustomKeyValueEventEnd:(NSString *)eventId withArgs:(NSDictionary *)args withExt:(NSString *)ext;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
计数事件统计
|
|
107
|
+
|
|
108
|
+
@param eventId 事件 Id,需要在个数后台配置才能生效
|
|
109
|
+
@param args 自定义属性,key 必须为 NSString 类型(注意:不能以$开头),value 仅支持NSNumber, BOOL, NSString, NSDate 4 种类型
|
|
110
|
+
@param ext 自定义ext字段内容。
|
|
111
|
+
*/
|
|
112
|
+
+ (void)trackCountEvent:(NSString *)eventId withArgs:(NSDictionary *)args withExt:(NSString *)ext;
|
|
113
|
+
|
|
114
|
+
/// App-H5打通
|
|
115
|
+
/// @param event H5传给App的事件内容
|
|
116
|
+
/// add at 2.0.8.0
|
|
117
|
+
+ (NSString*)onBridgeEvent:(NSString *)event;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
用户属性设置
|
|
121
|
+
|
|
122
|
+
@param profiles 用户属性参数,key 必须为 NSString 类型,value 仅支持NSNumber, BOOL, NSString, NSDate 4 种类型
|
|
123
|
+
@param ext 自定义ext字段内容。
|
|
124
|
+
*/
|
|
125
|
+
+ (void)setProfile:(NSDictionary *)profiles withExt:(NSString *)ext;
|
|
126
|
+
+ (void)setProfile:(NSDictionary *)profiles;
|
|
127
|
+
|
|
128
|
+
/// 对应GTSDK应用内弹窗回调的展示埋点
|
|
129
|
+
/// - Parameter dic: 弹窗数据
|
|
130
|
+
+ (void)popupDidShow:(NSDictionary *)dic;
|
|
131
|
+
|
|
132
|
+
/// 对应GTSDK应用内弹窗回调的点击埋点
|
|
133
|
+
/// - Parameter dic: 弹窗数据
|
|
134
|
+
+ (void)popupDidClick:(NSDictionary *)dic;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
是否启动开发者模式,在该模式下数据会实时上传,并且将会打印相关的数据上传信息
|
|
138
|
+
|
|
139
|
+
@param isDebug 是否开启
|
|
140
|
+
*/
|
|
141
|
+
+ (void)setDebugEnable:(BOOL)isDebug;
|
|
142
|
+
|
|
143
|
+
+ (NSString *)sdkVersion;
|
|
144
|
+
|
|
145
|
+
@end
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>NSPrivacyAccessedAPITypes</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
9
|
+
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
|
10
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
11
|
+
<array>
|
|
12
|
+
<string>35F9.1</string>
|
|
13
|
+
</array>
|
|
14
|
+
</dict>
|
|
15
|
+
<dict>
|
|
16
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
17
|
+
<array>
|
|
18
|
+
<string>CA92.1</string>
|
|
19
|
+
</array>
|
|
20
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
21
|
+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
22
|
+
</dict>
|
|
23
|
+
</array>
|
|
24
|
+
<key>NSPrivacyCollectedDataTypes</key>
|
|
25
|
+
<array>
|
|
26
|
+
<dict>
|
|
27
|
+
<key>NSPrivacyCollectedDataType</key>
|
|
28
|
+
<string>NSPrivacyCollectedDataTypeProductInteraction</string>
|
|
29
|
+
<key>NSPrivacyCollectedDataTypeLinked</key>
|
|
30
|
+
<false/>
|
|
31
|
+
<key>NSPrivacyCollectedDataTypeTracking</key>
|
|
32
|
+
<false/>
|
|
33
|
+
<key>NSPrivacyCollectedDataTypePurposes</key>
|
|
34
|
+
<array>
|
|
35
|
+
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
|
36
|
+
</array>
|
|
37
|
+
</dict>
|
|
38
|
+
</array>
|
|
39
|
+
<key>NSPrivacyTracking</key>
|
|
40
|
+
<false/>
|
|
41
|
+
<key>NSPrivacyTrackingDomains</key>
|
|
42
|
+
<array/>
|
|
43
|
+
</dict>
|
|
44
|
+
</plist>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>files</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>Headers/GTCountSDK.h</key>
|
|
8
|
+
<data>
|
|
9
|
+
CQHsfvpCPONnC5OrbnI0i5aeqKM=
|
|
10
|
+
</data>
|
|
11
|
+
<key>Info.plist</key>
|
|
12
|
+
<data>
|
|
13
|
+
Z3IVaxSqW+t3IcyjTccaqou9pDM=
|
|
14
|
+
</data>
|
|
15
|
+
<key>Modules/module.modulemap</key>
|
|
16
|
+
<data>
|
|
17
|
+
d973La930njOmNXzzJt7GzB0hgA=
|
|
18
|
+
</data>
|
|
19
|
+
<key>PrivacyInfo.xcprivacy</key>
|
|
20
|
+
<data>
|
|
21
|
+
Q1CGfe9DPAwptjQV7990y2uQZV0=
|
|
22
|
+
</data>
|
|
23
|
+
</dict>
|
|
24
|
+
<key>files2</key>
|
|
25
|
+
<dict>
|
|
26
|
+
<key>Headers/GTCountSDK.h</key>
|
|
27
|
+
<dict>
|
|
28
|
+
<key>hash</key>
|
|
29
|
+
<data>
|
|
30
|
+
CQHsfvpCPONnC5OrbnI0i5aeqKM=
|
|
31
|
+
</data>
|
|
32
|
+
<key>hash2</key>
|
|
33
|
+
<data>
|
|
34
|
+
Us8D2Bjzr1SLuHVI0863F3fMtTVW+J8sTZ3vSeu3FGs=
|
|
35
|
+
</data>
|
|
36
|
+
</dict>
|
|
37
|
+
<key>Modules/module.modulemap</key>
|
|
38
|
+
<dict>
|
|
39
|
+
<key>hash</key>
|
|
40
|
+
<data>
|
|
41
|
+
d973La930njOmNXzzJt7GzB0hgA=
|
|
42
|
+
</data>
|
|
43
|
+
<key>hash2</key>
|
|
44
|
+
<data>
|
|
45
|
+
nba78vE9vMHfBgRxgL3Wi1l4jlsRgTP58xONVEqTn7o=
|
|
46
|
+
</data>
|
|
47
|
+
</dict>
|
|
48
|
+
<key>PrivacyInfo.xcprivacy</key>
|
|
49
|
+
<dict>
|
|
50
|
+
<key>hash</key>
|
|
51
|
+
<data>
|
|
52
|
+
Q1CGfe9DPAwptjQV7990y2uQZV0=
|
|
53
|
+
</data>
|
|
54
|
+
<key>hash2</key>
|
|
55
|
+
<data>
|
|
56
|
+
duOfBGnnnAHZ1OYTAqHSfkkJXIU/RPRfjrt+VI47W40=
|
|
57
|
+
</data>
|
|
58
|
+
</dict>
|
|
59
|
+
</dict>
|
|
60
|
+
<key>rules</key>
|
|
61
|
+
<dict>
|
|
62
|
+
<key>^.*</key>
|
|
63
|
+
<true/>
|
|
64
|
+
<key>^.*\.lproj/</key>
|
|
65
|
+
<dict>
|
|
66
|
+
<key>optional</key>
|
|
67
|
+
<true/>
|
|
68
|
+
<key>weight</key>
|
|
69
|
+
<real>1000</real>
|
|
70
|
+
</dict>
|
|
71
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
72
|
+
<dict>
|
|
73
|
+
<key>omit</key>
|
|
74
|
+
<true/>
|
|
75
|
+
<key>weight</key>
|
|
76
|
+
<real>1100</real>
|
|
77
|
+
</dict>
|
|
78
|
+
<key>^Base\.lproj/</key>
|
|
79
|
+
<dict>
|
|
80
|
+
<key>weight</key>
|
|
81
|
+
<real>1010</real>
|
|
82
|
+
</dict>
|
|
83
|
+
<key>^version.plist$</key>
|
|
84
|
+
<true/>
|
|
85
|
+
</dict>
|
|
86
|
+
<key>rules2</key>
|
|
87
|
+
<dict>
|
|
88
|
+
<key>.*\.dSYM($|/)</key>
|
|
89
|
+
<dict>
|
|
90
|
+
<key>weight</key>
|
|
91
|
+
<real>11</real>
|
|
92
|
+
</dict>
|
|
93
|
+
<key>^(.*/)?\.DS_Store$</key>
|
|
94
|
+
<dict>
|
|
95
|
+
<key>omit</key>
|
|
96
|
+
<true/>
|
|
97
|
+
<key>weight</key>
|
|
98
|
+
<real>2000</real>
|
|
99
|
+
</dict>
|
|
100
|
+
<key>^.*</key>
|
|
101
|
+
<true/>
|
|
102
|
+
<key>^.*\.lproj/</key>
|
|
103
|
+
<dict>
|
|
104
|
+
<key>optional</key>
|
|
105
|
+
<true/>
|
|
106
|
+
<key>weight</key>
|
|
107
|
+
<real>1000</real>
|
|
108
|
+
</dict>
|
|
109
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
110
|
+
<dict>
|
|
111
|
+
<key>omit</key>
|
|
112
|
+
<true/>
|
|
113
|
+
<key>weight</key>
|
|
114
|
+
<real>1100</real>
|
|
115
|
+
</dict>
|
|
116
|
+
<key>^Base\.lproj/</key>
|
|
117
|
+
<dict>
|
|
118
|
+
<key>weight</key>
|
|
119
|
+
<real>1010</real>
|
|
120
|
+
</dict>
|
|
121
|
+
<key>^Info\.plist$</key>
|
|
122
|
+
<dict>
|
|
123
|
+
<key>omit</key>
|
|
124
|
+
<true/>
|
|
125
|
+
<key>weight</key>
|
|
126
|
+
<real>20</real>
|
|
127
|
+
</dict>
|
|
128
|
+
<key>^PkgInfo$</key>
|
|
129
|
+
<dict>
|
|
130
|
+
<key>omit</key>
|
|
131
|
+
<true/>
|
|
132
|
+
<key>weight</key>
|
|
133
|
+
<real>20</real>
|
|
134
|
+
</dict>
|
|
135
|
+
<key>^embedded\.provisionprofile$</key>
|
|
136
|
+
<dict>
|
|
137
|
+
<key>weight</key>
|
|
138
|
+
<real>20</real>
|
|
139
|
+
</dict>
|
|
140
|
+
<key>^version\.plist$</key>
|
|
141
|
+
<dict>
|
|
142
|
+
<key>weight</key>
|
|
143
|
+
<real>20</real>
|
|
144
|
+
</dict>
|
|
145
|
+
</dict>
|
|
146
|
+
</dict>
|
|
147
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RCTGetuiIdoModule.h
|
|
3
|
+
// RCTGetuiIdoModule
|
|
4
|
+
//
|
|
5
|
+
// Created by admin on 17/2/27.
|
|
6
|
+
// Copyright © 2017年 getui. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#if __has_include(<React/RCTBridgeModule.h>)
|
|
12
|
+
#import <React/RCTBridgeModule.h>
|
|
13
|
+
#elif __has_include("RCTBridgeModule.h")
|
|
14
|
+
#import "RCTBridgeModule.h"
|
|
15
|
+
#elif __has_include("React/RCTBridgeModule.h")
|
|
16
|
+
#import "React/RCTBridgeModule.h"
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
#import <GTCountSDK/GTCountSDK.h>
|
|
20
|
+
|
|
21
|
+
@interface RCTGetuiIdoModule : NSObject<RCTBridgeModule, GTCountSDKDelegate>
|
|
22
|
+
+ (instancetype)sharedGetuiIdoModule;
|
|
23
|
+
@end
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RCTGetuiIdoModule3.m
|
|
3
|
+
// RCTGetuiIdoModule3
|
|
4
|
+
//
|
|
5
|
+
// Created by admin on 17/2/27.
|
|
6
|
+
// Copyright © 2017年 getui. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "RCTGetuiIdoModule.h"
|
|
10
|
+
|
|
11
|
+
#if __has_include(<React/RCTBridge.h>)
|
|
12
|
+
#import <React/RCTEventDispatcher.h>
|
|
13
|
+
#import <React/RCTRootView.h>
|
|
14
|
+
#import <React/RCTBridge.h>
|
|
15
|
+
#import <React/RCTLog.h>
|
|
16
|
+
#import <React/RCTEventEmitter.h>
|
|
17
|
+
|
|
18
|
+
#elif __has_include("RCTBridge.h")
|
|
19
|
+
#import "RCTEventDispatcher.h"
|
|
20
|
+
#import "RCTRootView.h"
|
|
21
|
+
#import "RCTBridge.h"
|
|
22
|
+
#import "RCTLog.h"
|
|
23
|
+
#import "RCTEventEmitter.h"
|
|
24
|
+
#elif __has_include("React/RCTBridge.h")
|
|
25
|
+
#import "React/RCTEventDispatcher.h"
|
|
26
|
+
#import "React/RCTRootView.h"
|
|
27
|
+
#import "React/RCTBridge.h"
|
|
28
|
+
#import "React/RCTLog.h"
|
|
29
|
+
#import "React/RCTEventEmitter.h"
|
|
30
|
+
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
#import <PushKit/PushKit.h>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@interface RCTGetuiIdoModuleEvent : NSObject
|
|
37
|
+
@property (nonatomic, copy) NSString *name;
|
|
38
|
+
@property (nonatomic) id body;
|
|
39
|
+
@end
|
|
40
|
+
@implementation RCTGetuiIdoModuleEvent
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@interface RCTGetuiIdoModule ()
|
|
45
|
+
@property (nonatomic, strong) NSMutableArray<RCTGetuiIdoModuleEvent *> *cachedEvents;
|
|
46
|
+
@end
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@implementation RCTGetuiIdoModule
|
|
50
|
+
|
|
51
|
+
@synthesize bridge = _bridge;
|
|
52
|
+
|
|
53
|
+
RCT_EXPORT_MODULE();
|
|
54
|
+
+ (instancetype)sharedGetuiIdoModule {
|
|
55
|
+
static RCTGetuiIdoModule *module;
|
|
56
|
+
static dispatch_once_t onceToken;
|
|
57
|
+
dispatch_once(&onceToken, ^{
|
|
58
|
+
module = [[super allocWithZone:NULL] init];
|
|
59
|
+
[module setup];
|
|
60
|
+
});
|
|
61
|
+
return module;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
+ (instancetype)allocWithZone:(struct _NSZone *)zone {
|
|
65
|
+
return [self sharedGetuiIdoModule];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
- (instancetype)init {
|
|
69
|
+
if ((self = [super init])) {
|
|
70
|
+
NSLog(@"IDOSDK>>>init self:%@",self);
|
|
71
|
+
}
|
|
72
|
+
return self;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- (void)setup {
|
|
76
|
+
NSLog(@"IDOSDK>>>setup");
|
|
77
|
+
self.cachedEvents = [NSMutableArray array];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//需要等待bridge被RN初始化后,才能回调JS
|
|
81
|
+
- (void)setBridge:(RCTBridge *)bridge {
|
|
82
|
+
NSLog(@"IDOSDK>>>setBridge %@", bridge);
|
|
83
|
+
_bridge = bridge;
|
|
84
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
85
|
+
[self performCachedEvents];
|
|
86
|
+
});
|
|
87
|
+
// dont work
|
|
88
|
+
// dispatch_async(self.methodQueue, ^{
|
|
89
|
+
// [self performCachedEvents];
|
|
90
|
+
// });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
- (RCTBridge *)bridge {
|
|
94
|
+
return _bridge;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
- (dispatch_queue_t)methodQueue
|
|
98
|
+
{
|
|
99
|
+
return dispatch_get_main_queue();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//RCT_EXPORT_METHOD(createClient:(NSDictionary *) options
|
|
103
|
+
// resolver:(RCTPromiseResolveBlock)resolve
|
|
104
|
+
// rejecter:(RCTPromiseRejectBlock)reject) {
|
|
105
|
+
//
|
|
106
|
+
//
|
|
107
|
+
// NSLog(@"IDOSDK>>>createClient bridge:%@ self:%@",[self bridge], self);
|
|
108
|
+
// resolve([NSNumber numberWithInt:123]);
|
|
109
|
+
//}
|
|
110
|
+
//
|
|
111
|
+
//RCT_EXPORT_METHOD(resume)
|
|
112
|
+
//{
|
|
113
|
+
// NSLog(@"IDOSDK>>>resume self:%@",self);
|
|
114
|
+
// [self.bridge.eventDispatcher sendDeviceEventWithName:@"GeTuiSdkDidRegisterClient"
|
|
115
|
+
// body:@{@"event": @"closing"
|
|
116
|
+
// }];
|
|
117
|
+
//}
|
|
118
|
+
|
|
119
|
+
- (void)performCachedEvents {
|
|
120
|
+
for (RCTGetuiIdoModuleEvent *event in self.cachedEvents) {
|
|
121
|
+
[self getui_sendAppEventWithName:event.name body:event.body];
|
|
122
|
+
}
|
|
123
|
+
[self.cachedEvents removeAllObjects];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
- (void)getui_sendAppEventWithName:(NSString *)name body:(id)body {
|
|
127
|
+
#if DEBUG
|
|
128
|
+
NSLog(@"IDOSDK>>>sendEvent name:%@ body:%@", name, body);
|
|
129
|
+
#endif
|
|
130
|
+
|
|
131
|
+
if(self.bridge) {
|
|
132
|
+
[self.bridge.eventDispatcher sendDeviceEventWithName:name body:body];
|
|
133
|
+
}else {
|
|
134
|
+
RCTGetuiIdoModuleEvent *event = [[RCTGetuiIdoModuleEvent alloc] init];
|
|
135
|
+
event.name = name;
|
|
136
|
+
event.body = body;
|
|
137
|
+
[self.cachedEvents addObject:event];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//MARK: - GTCountSDKDelegate
|
|
142
|
+
|
|
143
|
+
- (void)GTCountSDKDidReceiveGtcid:(NSString *)gtcid error:(NSError *)error {
|
|
144
|
+
NSLog(@"IDOSDK>>>GTCountSDKDidReceiveGtcid %@",clientId);
|
|
145
|
+
[self getui_sendAppEventWithName:@"GTCountSDKDidReceiveGtcid"
|
|
146
|
+
body:gtcid];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
//MARK: -- SDK
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
//+ (void)startSDKWithAppId:(NSString *)appId withChannelId:(NSString *)channelId delegate:(id<GTCountSDKDelegate>)delegate;
|
|
153
|
+
/**
|
|
154
|
+
* 销毁SDK,并且释放资源
|
|
155
|
+
*/
|
|
156
|
+
RCT_EXPORT_METHOD(startSDK:(NSString *)appId withChannelId:(NSString *)channelId)
|
|
157
|
+
{
|
|
158
|
+
|
|
159
|
+
NSLog(@"IDOSDK>>>startSDKWithAppId %@ %@", appId, channelId);
|
|
160
|
+
[GTCountSDK startSDKWithAppId:appId withChannelId:channelId delegate:self];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
RCT_EXPORT_METHOD(version:(RCTResponseSenderBlock)callback)
|
|
164
|
+
{
|
|
165
|
+
NSLog(@"IDOSDK>>>version");
|
|
166
|
+
callback(@[[GTCountSDK sdkVersion]]);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
RCT_EXPORT_METHOD(gtcid:(RCTResponseSenderBlock)callback)
|
|
170
|
+
{
|
|
171
|
+
NSLog(@"IDOSDK>>>gtcid");
|
|
172
|
+
NSString *gtcid = [GTCountSDK gtcid]?:@"";
|
|
173
|
+
callback(@[gtcid]);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
//MARK: - Properties
|
|
177
|
+
|
|
178
|
+
RCT_EXPORT_METHOD(setDebugEnable:(BOOL)isDebug)
|
|
179
|
+
{
|
|
180
|
+
NSLog(@"IDOSDK>>>setDebugEnable %@", @(isDebug));
|
|
181
|
+
[GTCountSDK setDebugEnable:isDebug];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
RCT_EXPORT_METHOD(setApplicationGroupIdentifier:(NSString*)identifier)
|
|
185
|
+
{
|
|
186
|
+
NSLog(@"IDOSDK>>>setApplicationGroupIdentifier %@", identifier);
|
|
187
|
+
[GTCountSDK setApplicationGroupIdentifier:identifier];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
RCT_EXPORT_METHOD(setSessionTime:(NSInteger)sessionTime)
|
|
191
|
+
{
|
|
192
|
+
NSLog(@"IDOSDK>>>setSessionTime %@", @(sessionTime));
|
|
193
|
+
[GTCountSDK sharedInstance].sessionTime = setSessionTime;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
RCT_EXPORT_METHOD(setMinAppActiveDuration:(NSInteger)minAppActiveDuration)
|
|
197
|
+
{
|
|
198
|
+
NSLog(@"IDOSDK>>>setMinAppActiveDuration %@", @(minAppActiveDuration));
|
|
199
|
+
[GTCountSDK sharedInstance].minAppActiveDuration = minAppActiveDuration;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
RCT_EXPORT_METHOD(setMaxAppActiveDuration:(NSInteger)maxAppActiveDuration)
|
|
203
|
+
{
|
|
204
|
+
NSLog(@"IDOSDK>>>setMaxAppActiveDuration %@", @(maxAppActiveDuration));
|
|
205
|
+
[GTCountSDK sharedInstance].maxAppActiveDuration = maxAppActiveDuration;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
RCT_EXPORT_METHOD(setEventUploadInterval:(NSInteger)eventUploadInterval)
|
|
209
|
+
{
|
|
210
|
+
NSLog(@"IDOSDK>>>setEventUploadInterval %@", @(eventUploadInterval));
|
|
211
|
+
[GTCountSDK sharedInstance].eventUploadInterval = eventUploadInterval;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
RCT_EXPORT_METHOD(setEventForceUploadSize:(NSInteger)eventForceUploadSize)
|
|
215
|
+
{
|
|
216
|
+
NSLog(@"IDOSDK>>>setEventForceUploadSize %@", @(eventForceUploadSize));
|
|
217
|
+
[GTCountSDK sharedInstance].eventForceUploadSize = eventForceUploadSize;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
RCT_EXPORT_METHOD(setProfileUploadInterval:(NSInteger)profileUploadInterval)
|
|
221
|
+
{
|
|
222
|
+
NSLog(@"IDOSDK>>>setProfileUploadInterval %@", @(profileUploadInterval));
|
|
223
|
+
[GTCountSDK sharedInstance].profileUploadInterval = profileUploadInterval;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
RCT_EXPORT_METHOD(setProfileForceUploadSize:(NSInteger)profileForceUploadSize)
|
|
227
|
+
{
|
|
228
|
+
NSLog(@"IDOSDK>>>setProfileForceUploadSize %@", @(profileForceUploadSize));
|
|
229
|
+
[GTCountSDK sharedInstance].profileForceUploadSize = profileForceUploadSize;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
RCT_EXPORT_METHOD(setUserId:(NSString*)userId)
|
|
233
|
+
{
|
|
234
|
+
NSLog(@"IDOSDK>>>setUserId %@", userId);
|
|
235
|
+
[GTCountSDK sharedInstance].userId = userId;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
RCT_EXPORT_METHOD(setSyncGenerateGtcid:(BOOL)syncGenerateGtcid)
|
|
239
|
+
{
|
|
240
|
+
NSLog(@"IDOSDK>>>setSyncGenerateGtcid %@", syncGenerateGtcid);
|
|
241
|
+
[GTCountSDK sharedInstance].syncGenerateGtcid = syncGenerateGtcid;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
RCT_EXPORT_METHOD(registerEventProperties:(NSDictionary*)properties)
|
|
245
|
+
{
|
|
246
|
+
NSLog(@"IDOSDK>>>registerEventProperties %@", syncGenerateGtcid);
|
|
247
|
+
[GTCountSDK registerEventProperties:properties];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
//MARK: - Track
|
|
251
|
+
|
|
252
|
+
RCT_EXPORT_METHOD(trackCustomKeyValueEventBegin:(NSString *)eventId)
|
|
253
|
+
{
|
|
254
|
+
NSLog(@"IDOSDK>>>trackCustomKeyValueEventBegin %@", eventId);
|
|
255
|
+
[GTCountSDK trackCustomKeyValueEventBegin:eventId];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
RCT_EXPORT_METHOD(trackCustomKeyValueEventEnd:(NSString *)eventId withArgs:(NSDictionary *)args withExt:(NSString *)ext)
|
|
260
|
+
{
|
|
261
|
+
NSLog(@"IDOSDK>>>trackCustomKeyValueEventEnd %@", eventId);
|
|
262
|
+
[GTCountSDK trackCustomKeyValueEventEnd:eventId withArgs:args withExt:ext];
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
RCT_EXPORT_METHOD(trackCountEvent:(NSString *)eventId withArgs:(NSDictionary *)args withExt:(NSString *)ext)
|
|
266
|
+
{
|
|
267
|
+
NSLog(@"IDOSDK>>>trackCountEvent %@", eventId);
|
|
268
|
+
[GTCountSDK trackCountEvent:eventId withArgs:args withExt:ext];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
RCT_EXPORT_METHOD(setProfile:(NSDictionary *)profiles withExt:(NSString *)ext)
|
|
272
|
+
{
|
|
273
|
+
NSLog(@"IDOSDK>>>setProfile %@", profiles);
|
|
274
|
+
[GTCountSDK setProfile:profiles withExt:ext];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
@end
|
|
279
|
+
|