少年修仙传客户端基础资源
MacBuilder
2018-08-23 2d4e349cd7f9f6b4a6fe005fd02ccfa6d6160f07
Fixed IOS SDK 逻辑增加读取差异化配置逻辑
2个文件已修改
39 ■■■■■ 已修改文件
Assets/Plugins/iOS/The2thWorldSDK/UniversalSDK.h 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Plugins/iOS/The2thWorldSDK/UniversalSDK.mm 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Plugins/iOS/The2thWorldSDK/UniversalSDK.h
@@ -49,12 +49,7 @@
#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
static NSString *JPush_AppKey      = @"22186239fee975f883198cf4";
static NSString *JPush_Channel     = @"Develop";
static BOOL     JPush_IsProduction = FALSE;
static NSString *FreeSDK_AppID     = @"508021130";
static NSString *ADSdk_Token;
@interface UniversalSDK : NSObject {
    UIWebView* m_UIWebView;
@@ -63,7 +58,7 @@
-(void) HandleUnityMessage:(NSString*) json;
-(void) Init;
-(void) FreeSDKInit;
-(void) FreeSDKInit:(NSString*)freeSdkAppID;
-(void) FreeSDKLoginOK;
-(void) FreeSDKCancelLogin;
-(id) APNativeJSONObject:(NSData*) data;
Assets/Plugins/iOS/The2thWorldSDK/UniversalSDK.mm
@@ -34,6 +34,9 @@
-(void) Init
{
    NSString* _configPath = [[NSBundle mainBundle] pathForResource:@"The2thWorldSDKConfig" ofType:@"plist"];
    NSMutableDictionary *_configDict = [[NSMutableDictionary alloc] initWithContentsOfFile:_configPath];
    UIDevice *_device = [UIDevice currentDevice];
    _device.batteryMonitoringEnabled = true;
    
@@ -72,7 +75,7 @@
    [self SendMessageToUnity:_dict];
    
    // 自由sdk初始化
    [self FreeSDKInit];
    [self FreeSDKInit:_configDict[@"FreeSDK_AppID"]];
    
    // 发送个推id
    [_dict removeAllObjects];
@@ -81,10 +84,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 +110,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 +272,10 @@
}
-(void)JPushInit:(NSDictionary*)launchOptions {
    NSLog(@"JPushInit Finished.");
    NSString* _configPath = [[NSBundle mainBundle] 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 +284,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 +356,11 @@
            [UIPasteboard generalPasteboard].string = _dict[@"content"];
            break;
        case U2S_FreePlatformInit:
            [self FreeSDKInit];
        {
            NSString* _configPath = [[NSBundle mainBundle] pathForResource:@"The2thWorldSDKConfig" ofType:@"plist"];
            NSMutableDictionary *_configDict = [[NSMutableDictionary alloc] initWithContentsOfFile:_configPath];
            [self FreeSDKInit:_configDict[@"FreeSDK_AppID"]];
        }
            break;
        case U2S_MakeKeyAndVisible:
        {