| | |
| | | |
| | | -(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; |
| | | |
| | |
| | | [self SendMessageToUnity:_dict]; |
| | | |
| | | // 自由sdk初始化 |
| | | [self FreeSDKInit]; |
| | | [self FreeSDKInit:_configDict[@"FreeSDK_AppID"]]; |
| | | |
| | | // 发送个推id |
| | | [_dict removeAllObjects]; |
| | |
| | | [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]; |
| | |
| | | } |
| | | } |
| | | |
| | | -(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: |
| | |
| | | } |
| | | |
| | | -(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){ |
| | |
| | | [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]; |
| | | } |
| | |
| | | [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: |
| | | { |