少年修仙传客户端基础资源
client_Zxw
2018-08-28 2cfc54da70f0639f662d2cd8ce08c69d813e9bd2
Assets/Plugins/iOS/The2thWorldSDK/UniversalSDK.mm
@@ -34,6 +34,10 @@
-(void) Init
{
    NSString *_bundlePath = [[NSBundle mainBundle] pathForResource:@"The2thWorldRES.bundle" ofType:nil];
    NSString* _configPath = [[NSBundle bundleWithPath:_bundlePath] pathForResource:@"The2thWorldSDKConfig" ofType:@"plist"];
    NSMutableDictionary *_configDict = [[NSMutableDictionary alloc] initWithContentsOfFile:_configPath];
    UIDevice *_device = [UIDevice currentDevice];
    _device.batteryMonitoringEnabled = true;
    
@@ -72,7 +76,7 @@
    [self SendMessageToUnity:_dict];
    
    // 自由sdk初始化
    [self FreeSDKInit];
    [self FreeSDKInit:_configDict[@"FreeSDK_AppID"]];
    
    // 发送个推id
    [_dict removeAllObjects];
@@ -81,10 +85,14 @@
    [self SendMessageToUnity:_dict];
    
    // 热云初始化
    [Tracking initWithAppKey:@"3c3724431309474be938e0b64d4ad74f" withChannelId:@"_default_"];
    [Tracking initWithAppKey:_configDict[@"TrackingIO_AppKey"]
               withChannelId:@"_default_"];
    
    // 今日头条
    [TTTracker startWithAppID:@"151709" channel:@"ios-snqxz" appName:@"少年奇侠传"];
    NSDictionary* _infoDictionary = [[NSBundle mainBundle] infoDictionary];
    [TTTracker startWithAppID:_configDict[@"TTTrack_AppID"]
                      channel:@"ios-snqxz"
                      appName:[_infoDictionary objectForKey:@"CFBundleDisplayName"]];
    
    // 发送初始化完成
    [_dict removeAllObjects];
@@ -103,8 +111,8 @@
    }
}
-(void) FreeSDKInit {
    [FreeSDK initSDKWithAppId:FreeSDK_AppID withSDKBlock:^(YLSDKType type, NSString *msg) {
-(void) FreeSDKInit:(NSString*)freeSdkAppID {
    [FreeSDK initSDKWithAppId:freeSdkAppID withSDKBlock:^(YLSDKType type, NSString *msg) {
        NSMutableDictionary *_dict = NULL;
        switch (type) {
            case YLSDKTypeInitSuccess:
@@ -265,7 +273,12 @@
}
-(void)JPushInit:(NSDictionary*)launchOptions {
    NSLog(@"JPushInit Finished.");
    NSString *_bundlePath = [[NSBundle mainBundle] pathForResource:@"The2thWorldRES.bundle" ofType:nil];
    NSString* _configPath = [[NSBundle bundleWithPath:_bundlePath] pathForResource:@"The2thWorldSDKConfig" ofType:@"plist"];
    NSMutableDictionary *_configDict = [[NSMutableDictionary alloc] initWithContentsOfFile:_configPath];
    JPUSHRegisterEntity *_entity = [[JPUSHRegisterEntity alloc] init];
    _entity.types = JPAuthorizationOptionAlert | JPAuthorizationOptionBadge | JPAuthorizationOptionSound;
    if([[UIDevice currentDevice].systemVersion floatValue] > 8.0){
@@ -274,8 +287,8 @@
    [JPUSHService registerForRemoteNotificationConfig:_entity
                                             delegate:self];
    [JPUSHService setupWithOption:launchOptions
                           appKey:JPush_AppKey
                          channel:JPush_Channel
                           appKey:_configDict[@"JPush_AppKey"]
                          channel:@"develop"
                 apsForProduction:JPush_IsProduction
            advertisingIdentifier:nil];
}
@@ -346,7 +359,13 @@
            [UIPasteboard generalPasteboard].string = _dict[@"content"];
            break;
        case U2S_FreePlatformInit:
            [self FreeSDKInit];
        {
            NSString *_bundlePath = [[NSBundle mainBundle] pathForResource:@"The2thWorldRES.bundle" ofType:nil];
            NSString* _configPath = [[NSBundle bundleWithPath:_bundlePath] pathForResource:@"The2thWorldSDKConfig" ofType:@"plist"];
            NSMutableDictionary *_configDict = [[NSMutableDictionary alloc] initWithContentsOfFile:_configPath];
            [self FreeSDKInit:_configDict[@"FreeSDK_AppID"]];
        }
            break;
        case U2S_MakeKeyAndVisible:
        {