| | |
| | | static int sBatteryLevel = -1; |
| | | static int sBatteryState = -1; |
| | | static NSThread * _thread; |
| | | static NSString* APP_ID; |
| | | |
| | | -(void) Init |
| | | { |
| | |
| | | /* 初始化SDK */ |
| | | [XHAuxiliarySDK setDelegate:self]; |
| | | |
| | | [[XHAuxiliarySDK defaultXHAuxiliary] XHAuxiliarySDKInitWithCompletion:^(XHAuxiliaryInitErrorCode result) { |
| | | [[XHAuxiliarySDK defaultXHAuxiliary] XHAuxiliarySDKInitWithAPPID:@"1071" Completion:^(XHAuxiliaryInitErrorCode result) { |
| | | |
| | | if (result == XHAuxiliaryInitErrorCodeNone) { |
| | | // 初始化SDK成功 |
| | |
| | | } |
| | | |
| | | }]; |
| | | |
| | | // [[MRSDK getInstance] registerLogoutSuccess:^{ |
| | | // NSLog(@"DK内部注销账号按钮注销成功"); |
| | | // NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys: |
| | | // [NSNumber numberWithInt:S2U_FreePlatformLogoutOk], @"code", nil]; |
| | | // |
| | | // [self SendMessageToUnity:_dict]; |
| | | // }]; |
| | | } |
| | | |
| | | |
| | |
| | | [NSNumber numberWithInt:S2U_FreePlatformPayOk],@"code",nil]; |
| | | [self SendMessageToUnity:_dict]; |
| | | }else if (result == XHAuxiliary_CANCEL){ |
| | | NSLog(@"取消 %@",data); |
| | | NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
| | | [NSNumber numberWithInt:S2U_FreePlatformPayFail],@"code",nil]; |
| | | [ self SendMessageToUnity:_dict]; |
| | |
| | | switch([[_dict objectForKey:@"code"] intValue]){ |
| | | case U2S_Init: |
| | | [self Init]; |
| | | APP_ID = [_dict objectForKey:@"appID"]; |
| | | break; |
| | | case U2S_CopyContent: |
| | | [UIPasteboard generalPasteboard].string = _dict[@"content"]; |
| | |
| | | _roleName = [_temp stringByReplacingOccurrencesOfString:@"\u0000" withString:@""]; |
| | | |
| | | NSString* _extraData = [NSString stringWithFormat:@"{\"appid\":\"%@\",\"cpinfo\":\"%@\",\"cporderid\":\"%@\"}", |
| | | @"jsgameios", |
| | | APP_ID, |
| | | [_dict objectForKey:@"cpInfo"], |
| | | [_dict objectForKey:@"orderId"]]; |
| | | |
| | |
| | | andWithLLItemP:[[_dict objectForKey:@"mount"] intValue] * 100 |
| | | andWithLLReserved:_extraData |
| | | andWithLLDesc:[_dict objectForKey:@"title"]]; |
| | | |
| | | |
| | | } |
| | | break; |
| | | case U2S_PayFinished: |