Skip to content

Commit dd8ec1d

Browse files
talkingdatatalkingdata
authored andcommitted
初始化接口拆分为两步
1 parent 897cbb7 commit dd8ec1d

File tree

22 files changed

+256
-143
lines changed

22 files changed

+256
-143
lines changed

talkingdata_sdk_plugin/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.1.0'
11+
classpath 'com.android.tools.build:gradle:7.4.1'
1212
}
1313
}
1414

talkingdata_sdk_plugin/android/src/main/java/com/talkingdata/talkingdata_sdk_plugin/TalkingDataSDKPlugin.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.tendcloud.tenddata.TalkingDataProfile;
1010
import com.tendcloud.tenddata.TalkingDataProfileType;
1111
import com.tendcloud.tenddata.TalkingDataSDK;
12+
import com.tendcloud.tenddata.TalkingDataSDKConfig;
1213
import com.tendcloud.tenddata.TalkingDataSearch;
1314
import com.tendcloud.tenddata.TalkingDataShoppingCart;
1415
import com.tendcloud.tenddata.TalkingDataTransaction;
@@ -58,9 +59,26 @@ public static Context getContext() {
5859
@Override
5960
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
6061
switch (call.method) {
62+
case "initSDK":
6163
case "init":
62-
TalkingDataSDK.init(mContext,(String) call.argument("appID"),(String) call.argument("channelID"),(String) call.argument("custom"));
64+
TalkingDataSDK.initSDK(mContext,(String) call.argument("appID"),(String) call.argument("channelID"),(String) call.argument("custom"));
6365
break;
66+
67+
case "startA":
68+
TalkingDataSDK.startA(mContext);
69+
break;
70+
case "setConfig":
71+
TalkingDataSDKConfig config = new TalkingDataSDKConfig();
72+
boolean imei = callTransBool(call,"IMEIAndMEID");
73+
boolean mac = callTransBool(call,"Mac");
74+
boolean appList = callTransBool(call,"AppList");
75+
boolean location =callTransBool(call,"Location");
76+
config.setAppListEnabled(appList)
77+
.setLocationEnabled(location)
78+
.setMACEnabled(mac)
79+
.setIMEIAndMEIDEnabled(imei);
80+
TalkingDataSDK.setConfig(config);
81+
break;
6482
case "getDeviceID":
6583
result.success(TalkingDataSDK.getDeviceId(mContext));
6684
break;
@@ -378,4 +396,12 @@ private int callTransInt(MethodCall call, String dsc) {
378396
return 0;
379397
}
380398
}
399+
400+
private boolean callTransBool(MethodCall call,String dsc){
401+
if(call.argument(dsc) != null){
402+
return call.argument(dsc);
403+
}else{
404+
return true;
405+
}
406+
}
381407
}

talkingdata_sdk_plugin/example/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.6.10'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
9+
classpath 'com.android.tools.build:gradle:7.4.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
@@ -26,6 +26,6 @@ subprojects {
2626
project.evaluationDependsOn(':app')
2727
}
2828

29-
task clean(type: Delete) {
29+
tasks.register("clean", Delete) {
3030
delete rootProject.buildDir
3131
}

talkingdata_sdk_plugin/example/assets/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"pageConfig" : [
33
{
44
"icon" : "images/basefunction.png",
5-
"title" : "Init",
6-
"content" : "SDK初始化",
5+
"title" : "Init&startA",
6+
"content" : "SDK初始化以及启动分析",
77
"pageName": "Init"
88
},
99
{

talkingdata_sdk_plugin/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

talkingdata_sdk_plugin/example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

talkingdata_sdk_plugin/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -165,7 +165,7 @@
165165
97C146E61CF9000F007C117D /* Project object */ = {
166166
isa = PBXProject;
167167
attributes = {
168-
LastUpgradeCheck = 1300;
168+
LastUpgradeCheck = 1430;
169169
ORGANIZATIONNAME = "";
170170
TargetAttributes = {
171171
97C146ED1CF9000F007C117D = {
@@ -208,10 +208,12 @@
208208
/* Begin PBXShellScriptBuildPhase section */
209209
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
210210
isa = PBXShellScriptBuildPhase;
211+
alwaysOutOfDate = 1;
211212
buildActionMask = 2147483647;
212213
files = (
213214
);
214215
inputPaths = (
216+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
215217
);
216218
name = "Thin Binary";
217219
outputPaths = (
@@ -244,6 +246,7 @@
244246
};
245247
9740EEB61CF901F6004384FC /* Run Script */ = {
246248
isa = PBXShellScriptBuildPhase;
249+
alwaysOutOfDate = 1;
247250
buildActionMask = 2147483647;
248251
files = (
249252
);
@@ -332,7 +335,7 @@
332335
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
333336
GCC_WARN_UNUSED_FUNCTION = YES;
334337
GCC_WARN_UNUSED_VARIABLE = YES;
335-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
338+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
336339
MTL_ENABLE_DEBUG_INFO = NO;
337340
SDKROOT = iphoneos;
338341
SUPPORTED_PLATFORMS = iphoneos;
@@ -407,7 +410,7 @@
407410
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
408411
GCC_WARN_UNUSED_FUNCTION = YES;
409412
GCC_WARN_UNUSED_VARIABLE = YES;
410-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
413+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
411414
MTL_ENABLE_DEBUG_INFO = YES;
412415
ONLY_ACTIVE_ARCH = YES;
413416
SDKROOT = iphoneos;
@@ -456,7 +459,7 @@
456459
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
457460
GCC_WARN_UNUSED_FUNCTION = YES;
458461
GCC_WARN_UNUSED_VARIABLE = YES;
459-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
462+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
460463
MTL_ENABLE_DEBUG_INFO = NO;
461464
SDKROOT = iphoneos;
462465
SUPPORTED_PLATFORMS = iphoneos;

talkingdata_sdk_plugin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

talkingdata_sdk_plugin/example/ios/Runner/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ - (BOOL)application:(UIApplication *)application
77
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
88
[GeneratedPluginRegistrant registerWithRegistry:self];
99
// Override point for customization after application launch.
10-
[TalkingDataSDKPlugin init:@"您的 App ID" channelId:@"渠道 ID" custom:@"自定义参数"];
10+
[TalkingDataSDKPlugin initSDK:@"您的 App ID" channelId:@"渠道 ID" custom:@"自定义参数"];
1111
return [super application:application didFinishLaunchingWithOptions:launchOptions];
1212
}
1313

talkingdata_sdk_plugin/example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,9 @@
4343
</array>
4444
<key>UIViewControllerBasedStatusBarAppearance</key>
4545
<false/>
46+
<key>CADisableMinimumFrameDurationOnPhone</key>
47+
<true/>
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true/>
4650
</dict>
4751
</plist>

0 commit comments

Comments
 (0)