| | |
| | | }
|
| | |
|
| | | -(void)QuickSDKInit:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
| | | [MYSDK application:application didFinishLaunchingWithOptions:launchOptions];
|
| | | NSLog(@"初始化成功");
|
| | |
|
| | |
|
| | | NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
| | | [NSNumber numberWithInt:S2U_SdkInitComplete], @"code",
|
| | | @"mlgtgame", @"channelPlatform", nil];
|
| | | [self SendMessageToUnity:_dict];
|
| | | |
| | | }
|
| | |
|
| | | //
|
| | | //- (void)smpcQpLoginResult:(NSNotification *)notify {
|
| | | // NSLog(@"登录成功通知%@",notify);
|
| | | // int error = [[[notify userInfo] objectForKey:kSmpcQuickSDKKeyError] intValue];
|
| | | // NSDictionary *userInfo = [notify userInfo];
|
| | | // if (error == 0) {
|
| | | // NSString *uid = [[SMPCQuickSDK defaultInstance] userId];
|
| | | // channel = [[SMPCQuickSDK defaultInstance] getConfigValue:@"channel"];
|
| | | // if(channel&&[channel length]!=0)
|
| | | // {
|
| | | //
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // channel = [NSString stringWithFormat:@"%d", [SMPCQuickSDK defaultInstance].channelType];
|
| | | // }
|
| | | // NSString *gameUID = [NSString stringWithFormat:@"%@@%@", uid, channel];
|
| | | // NSString *UserName = [[SMPCQuickSDK defaultInstance] userId];
|
| | | // //获取user_token,用于从服务器去验证用户信息
|
| | | // NSString *user_token = userInfo[kSmpcQuickSDKKeyUserToken];
|
| | | //
|
| | | // NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
| | | // [NSDictionary dictionaryWithObjectsAndKeys:user_token, @"token",
|
| | | // UserName, @"userName",
|
| | | // gameUID, @"account", nil],@"info",
|
| | | // [NSNumber numberWithInt:S2U_FreePlatformLoginOk], @"code", nil];
|
| | | // [self SendMessageToUnity:_dict];
|
| | | // }
|
| | | //}
|
| | | //
|
| | | //- (void)smpcQpLogoutResult:(NSNotification *)notify {
|
| | | // NSLog(@"%s",__func__);
|
| | | // NSDictionary *userInfo = notify.userInfo;
|
| | | // int errorCode = [userInfo[kSmpcQuickSDKKeyError] intValue];
|
| | | // switch (errorCode) {
|
| | | // case SMPC_QUICK_SDK_ERROR_NONE:
|
| | | // {
|
| | | // NSLog(@"注销成功");
|
| | | // //注销成功
|
| | | // NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:S2U_FreePlatformLogoutOk], @"code", nil];
|
| | | // [self SendMessageToUnity:_dict];
|
| | | // }
|
| | | // break;
|
| | | // case SMPC_QUICK_SDK_ERROR_LOGOUT_FAIL:
|
| | | // default:
|
| | | // {
|
| | | // //注销失败
|
| | | // NSLog(@"注销失败");
|
| | | // }
|
| | | // break;
|
| | | // }
|
| | | // if (errorCode == SMPC_QUICK_SDK_ERROR_NONE) {
|
| | | //
|
| | | // }
|
| | | //
|
| | | //}
|
| | |
|
| | | //- (void)smpcQpRechargeResult:(NSNotification *)notify{
|
| | | // NSLog(@"充值结果%@",notify);
|
| | | // NSDictionary *userInfo = notify.userInfo;
|
| | | // int error = [[userInfo objectForKey:kSmpcQuickSDKKeyError] intValue];
|
| | | // switch (error) {
|
| | | // case SMPC_QUICK_SDK_ERROR_NONE:
|
| | | // {
|
| | | // //充值成功
|
| | | // //QuickSDK订单号,cp下单时传入的订单号,渠道sdk的订单号,cp下单时传入的扩展参数
|
| | | // NSString *orderID = userInfo[kSmpcQuickSDKKeyOrderId];
|
| | | // NSString *cpOrderID = userInfo[kSmpcQuickSDKKeyCpOrderId];
|
| | | // NSLog(@"充值成功数据:%@,%@",orderID,cpOrderID);
|
| | | // NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
| | | // [NSNumber numberWithInt:S2U_FreePlatformPayOk], @"code", nil];
|
| | | // [self SendMessageToUnity:_dict];
|
| | | // }
|
| | | // break;
|
| | | // case SMPC_QUICK_SDK_ERROR_RECHARGE_CANCELLED:
|
| | | // case SMPC_QUICK_SDK_ERROR_RECHARGE_FAILED:
|
| | | // {
|
| | | // //充值失败
|
| | | // NSString *orderID = userInfo[kSmpcQuickSDKKeyOrderId];
|
| | | // NSString *cpOrderID = userInfo[kSmpcQuickSDKKeyCpOrderId];
|
| | | // NSLog(@"充值失败数据%@,%@",orderID,cpOrderID);
|
| | | // NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
| | | // [NSNumber numberWithInt:S2U_FreePlatformPayFail], @"code", nil];
|
| | | // [self SendMessageToUnity:_dict];
|
| | | // }
|
| | | // break;
|
| | | // default:
|
| | | // break;
|
| | | // }
|
| | | //}
|
| | |
|
| | | -(id) APNativeJSONObject:(NSData *)data{
|
| | | if (!data) {
|