hch
2023-05-16 b3912f8992f4b084db043970113615d50c4ba0d2
0312 qkbt10game ios
1个文件已修改
12个文件已添加
1099 ■■■■■ 已修改文件
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDK.h 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKDefines.h 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKGameRoleInfo.h 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKInitConfigure.h 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKPayOrderInfo.h 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKShareInfo.h 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/SMPCQuickSDK 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/libSMPCQuickChannel.a 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/The2thWorldRES.bundle/TY_AN_34.png 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/The2thWorldRES.bundle/The2thWorldSDKConfig.plist 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/UniversalSDK.h 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/UniversalSDK.mm 585 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
新增渠道.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDK.h
New file
@@ -0,0 +1,226 @@
//
//  SMPCQuickSDK.h
//
//
//
//
#define SMPC_QUICK_SDK_VERSION @"2.5.4" //QuickSDK基础库版本
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "SMPCQuickSDKDefines.h"
#import "SMPCQuickSDKInitConfigure.h"
#import "SMPCQuickSDKPayOrderInfo.h"
#import "SMPCQuickSDKGameRoleInfo.h"
#import "SMPCQuickSDKShareInfo.h"
typedef enum {
    QuickSDKUserTYPE_UNKnow        = 0,//未知的未定义的
    QuickSDKUserTYPE_Account       = 1,//账号
    QuickSDKUserTYPE_Phone         = 2,//手机号
    QuickSDKUserTYPE_Guest         = 3,//游客登录
    QuickSDKUserTYPE_WX            = 4,//微信
    QuickSDKUserTYPE_QQ            = 5,//手Q
    QuickSDKUserTYPE_WeiBo         = 6,//微博
    QuickSDKUserTYPE_GameCenter    = 7,//GameCenter
    QuickSDKUserTYPE_Apple         = 16,//苹果
    QuickSDKUserTYPE_OneKey        = 18,//阿里云一键登录
} QuickSDKUserTYPE;
#pragma mark åŸºæœ¬ä¿¡æ¯
@interface SMPCQuickSDK : NSObject
#pragma mark å•例对象
+ (SMPCQuickSDK *)defaultInstance;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
#pragma mark èŽ·å–æ¸ é“åŸºæœ¬ä¿¡æ¯
//获取渠道唯一标识,与服务器端channelID一致,任何时刻都可调用
- (int)channelType;
/**
 * èŽ·å–QuickGame渠道cps包的渠道号
 */
- (NSString *)cpsChannelId;
@end
#pragma mark - åˆå§‹åŒ– æŽ¥å…¥äº§å“ä¿¡æ¯
@interface SMPCQuickSDK(Base)
#pragma mark åˆå§‹åŒ–
/**
 @brief åº”用初始化 å®ŒæˆåŽä¼šå‘送通知kSmpcQuickSDKNotiInitDidFinished
 @param configure åˆå§‹åŒ–配置类,SDK会优先使用打包工具上在线配置的productCode
 @result é”™è¯¯ç 
 @note å¿…接
 */
- (int)initWithConfig:(SMPCQuickSDKInitConfigure *)configure application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
/**
 @brief è°ƒç”¨ç»„件功能,参数请看对应组件接入文档
 */
- (int)callPlug:(NSString *)name params:(NSArray *)args;
@end
#pragma mark - ç”¨æˆ·éƒ¨åˆ† ç™»å½• æ³¨å†Œ ç™»å‡º
@interface SMPCQuickSDK(Account)
/**
 @brief ç™»å½•接口 ï¼Œç™»å½•后会发送kSmpcQuickSDKNotiLogin通知
 @result é”™è¯¯ç 
 @note å¿…接
 */
- (int)login;
/**
 @brief ç™»å‡ºæŽ¥å£ ä»£ç è°ƒç”¨æ³¨é”€
 @result é”™è¯¯ç 
 @note æˆåŠŸè°ƒç”¨è¯¥æŽ¥å£åŽï¼ŒSDK会发出kSmpcQuickSDKNotiLogout通知
 */
- (int)logout;
// ç™»å½•后获取用户uid,这个uid在渠道上唯一,多个渠道的用户uid可能重复
- (NSString *)userId;
// ç™»å½•后获取userToken可用于验证用户信息
- (NSString *)userToken;
// ç™»å½•后获取用户昵称
- (NSString *)userNick;
/** æŸ¥è¯¢æ¸ é“实名认证信息 */
- (NSDictionary *)realNameInfo;
/** èŽ·å–è®¾å¤‡id */
- (NSString *)getDeviceID;
/** æ¸…除设备id缓存数据 */
- (void)resetDeviceID;
/**
 @brief è°ƒç”¨æ¸ é“实名认证
 @result é”™è¯¯ç è‹¥æ¸ é“没有提供此方法会返回非0
 @note ç»“果会发送kSmpcQuickSDKNotiRealAuth通知
*/
- (int)realAuth;
/** èŽ·å–æ¸ é“ç”¨æˆ·ç™»å½•æ–¹å¼ç›®å‰ä»…QuickGame越狱渠道有用 */
- (QuickSDKUserTYPE)getChannelUserLoginType;
/** èŽ·å–ç”¨æˆ·é¢å¤–ä¿¡æ¯ï¼Œè‹¥æ²¡æœ‰é¢å¤–ä¿¡æ¯åˆ™è¿”å›žç©ºå­—å…¸ */
- (NSDictionary *)getChannelUserExtInfo;
#pragma mark - æ›´æ–°è§’色信息
// è¿›å…¥æ¸¸æˆè§’色,角色信息变更时调用(比如升级),请使用updateRoleInfoWith:isCreate:
- (void)updateRoleInfoWith:(SMPCQuickSDKGameRoleInfo *)info;
//// åˆ›å»ºè§’色、进入游戏角色、角色信息变更时调用(比如升级,isCreate表示是否为创建角色
- (void)updateRoleInfoWith:(SMPCQuickSDKGameRoleInfo *)info isCreate:(BOOL)isCreate;
@end
//MARK:- å……值
@interface SMPCQuickSDK(Pay)
/**
 @brief å•†å“è´­ä¹°
 *  @param orderInfo
 *  @param roleInfo
 @result é”™è¯¯ç 
 */
- (int)payOrderInfo:(SMPCQuickSDKPayOrderInfo *)orderInfo
           roleInfo:(SMPCQuickSDKGameRoleInfo *)roleInfo;
/**
 @brief å•†å“ä¿¡æ¯
 *  @param productId å•†å“id
 */
-(void)Getlocalized:(NSString *)productIds;
@end
#pragma mark - ç•Œé¢æŽ§åˆ¶
@interface SMPCQuickSDK(UISetting)
#pragma mark æµ®åŠ¨æ¡
/**
 @brief showToolBar:
 @brief æµ®åŠ¨å·¥å…·æ ï¼Œå»ºè®®æ˜¾ç¤ºåœ¨å·¦ä¸Šè§’
 @result é”™è¯¯ç 
 @note
 */
- (int)showToolBar:(SMPC_QUICK_SDK_TOOLBAR_PLACE)place;
//隐藏浮动工具栏
- (int)hideToolBar;
@end
@interface SMPCQuickSDK(Extend)
// èŽ·å–QuicSDK后台为渠道添加的自定义键值,任何时刻都可调用
// å¦‚果没有将返回nil
- (NSString *)getConfigValue:(NSString *)key;
/**
 @brief isFunctionSupported:
 @brief åˆ¤æ–­å½“前渠道是否实现了QuickSDK提供的某个接口
 @brief å¦‚果当前渠道没有实现相应接口,就没有相应接口的回调
 @brief ä¾‹å¦‚渠道SDK没有实现pausedGame这个接口,即使调用了pausedGame,没有暂停恢复通知,因为pausedGame调用无效
 @result æ˜¯å¦
 @note
 */
- (BOOL)isFunctionTypeSupported:(SMPC_QUICK_SDK_FUNC_TYPE)type;
/**
 @brief è¿›å…¥ç”¨æˆ·ä¸­å¿ƒ å¦‚用户注销登录会发送kSmpcQPLogoutNotification(可多次触发)
 @result é”™è¯¯ç 
 */
- (int)enterUserCenter;
/**
 @brief è°ƒç”¨æ¸ é“特定方法
 parameterDict: è°ƒç”¨æ–¹æ³•需要传入的参数,如果没有则传入@{}
 @result é”™è¯¯ç 
 */
- (int)callChannelSpecifyFunction:(NSInteger)functionName parameters:(NSDictionary *)parameterDict;
/**
 è¿›å…¥YunKefu
 @param gameRoleInfo
 @result é”™è¯¯ç 
 */
- (int)enterYunKeFuCenter:(SMPCQuickSDKGameRoleInfo *)gameRoleInfo;
#pragma mark åˆ†äº«
/**
 åˆ†äº«
 @param shareInfo shareInfo description
 @result é”™è¯¯ç 
 */
- (int)callSDKShare:(SMPCQuickSDKShareInfo *)shareInfo;
//***********************应用生命周期的回调*******************//
//在应用对应的生命周期回调中调用
/**
 @brief - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
 @brief - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation
 @brief - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
 @brief æ¸ é“处理应用跳转
 @result é”™è¯¯ç 
 @note å¿…接
 */
- (int)openURL:(NSURL *)url application:(UIApplication *)application;
- (int)openURL:(NSURL *)url sourceApplication:(NSString *)sourceApp application:(UIApplication *)application annotation:(id)annotation;
- (int)openURL:(NSURL *)url application:(UIApplication *)app options:(NSDictionary <NSString *, id>*)options;
/**
 @brief application:didRegisterForRemoteNotificationsWithDeviceToken:
 @brief æŽ¨é€æ¶ˆæ¯
 @result é”™è¯¯ç 
 @note å¿…接
 */
- (int)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
/**
 @brief application:didFailToRegisterForRemoteNotificationsWithError:
 @brief æŽ¨é€æ¶ˆæ¯
 @result é”™è¯¯ç 
 @note å¿…接
 */
- (int)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error;
- (int)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
- (int)applicationWillResignActive:(UIApplication *)application;
- (int)applicationDidEnterBackground:(UIApplication *)application;
- (int)applicationWillEnterForeground:(UIApplication *)application;
- (int)applicationDidBecomeActive:(UIApplication *)application;
- (int)applicationWillTerminate:(UIApplication *)application;
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray *  restorableObjects))restorationHandler;
@end
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKDefines.h
New file
@@ -0,0 +1,91 @@
//
//  SMPCQuickSDKDefines.h
//  QuickSDKs
//
//
//
#ifndef SMPCQuickSDKDefines_h
#define SMPCQuickSDKDefines_h
#pragma mark - Notification Name
extern NSString* const kSmpcQuickSDKNotiInitDidFinished;   //初始化成功
extern NSString* const kSmpcQuickSDKNotiLogin;             //登录成功 åˆ‡æ¢è´¦å·æˆåŠŸä¹Ÿä¼šå›žè°ƒè¿™ä¸ª
extern NSString* const kSmpcQCGetLocalizedNotification;             //查询接商品信息的通知
extern NSString* const kSmpcQuickSDKNotiLogout;            //用户注销
extern NSString* const kSmpcQuickSDKNotiRecharge;          //充值结果
extern NSString* const kSmpcQuickSDKNotiPauseOver;         //暂停结束 è¿™ä¸ªå›žè°ƒå¯ä»¥ä¸ç”¨ç›‘听
extern NSString * const kSmpcQuickSDKNotiPlugin;           /*组件通知 è§è¯¥æ’件接入文档,默认可以不用监听*/
extern NSString* const kSmpcQuickSDKNotiRealAuth;             //实名认证结果通知
#define QUICK_CHANNEL_TO_CP_NOTIFICATON_KEY @"quick_channel_to_cp_notification_key" //QUICK_CHANNEL_TO_CP_NOTIFICATON_KEY这个键定义了QuickSDK标准接口不能提供更多的信息给cp那边时的传输方案,这个通知带上渠道SDK需要传递到cp的信息.通常不需要,遇到了再讨论
#pragma mark - é€šçŸ¥userInfo中的重要key é”™è¯¯å’Œä¿¡æ¯
extern NSString* const kSmpcQuickSDKKeyError;    /*Notification userinfo error Key */
extern NSString* const kSmpcQuickSDKKeyMsg;      /*Notification userinfo msg   Key */
// è®¢å•号
#define kSmpcQuickSDKKeyOrderId              @"orderId"
// æ¸¸æˆå¼€å‘商给的订单号
#define kSmpcQuickSDKKeyCpOrderId            @"cpOrderId"
// ç¬¬3方渠道sdk给的订单号
#define kSmpcQuickSDKKeySdkOrderId           @"sdkOrderId"
// é€ä¼ å‚æ•°
#define kSmpcQuickSDKKeyExtraParams          @"extraParams"
// user_token
#define kSmpcQuickSDKKeyUserToken            @"user_token"
/** å®žåè®¤è¯å›žè°ƒæ˜¯å¦å·²å®žå YES:已认证NO:未认证*/
#define kSmpcQuickSDKKeyRealName              @"realName"
/** å®žåè®¤è¯åŽå¹´é¾„ */
#define kSmpcQuickSDKKeyRealAge              @"age"
/** æ¸ é“实名认证失败是否可以继续游戏 YES:可以 NO:不可以 */
#define kSmpcQuickSDKKeyRealResumeGame              @"resumeGame"
/** å®žåè®¤è¯é¢„留字段 */
#define kSmpcQuickSDKKeyRealOther              @"other"
#pragma mark - æµ®åŠ¨æ¡ä½ç½® Enum
typedef enum {
    SMPC_QUICK_SDK_TOOLBAR_TOP_LEFT  = 1,           /* å·¦ä¸Š */
    SMPC_QUICK_SDK_TOOLBAR_TOP_RIGHT = 2,           /* å³ä¸Š */
    SMPC_QUICK_SDK_TOOLBAR_MID_LEFT  = 3,           /* å·¦ä¸­ */
    SMPC_QUICK_SDK_TOOLBAR_MID_RIGHT = 4,           /* å³ä¸­ */
    SMPC_QUICK_SDK_TOOLBAR_BOT_LEFT  = 5,           /* å·¦ä¸‹ */
    SMPC_QUICK_SDK_TOOLBAR_BOT_RIGHT = 6,           /* å³ä¸‹ */
}SMPC_QUICK_SDK_TOOLBAR_PLACE;
#pragma mark - é”™è¯¯ç 
typedef enum {
    SMPC_QUICK_SDK_ERROR_NONE                      = 0,    /* æ²¡æœ‰é”™è¯¯ */
    SMPC_QUICK_SDK_ERROR_UNKNOWN                   = -1,    /* æœªçŸ¥é”™è¯¯ */
    SMPC_QUICK_SDK_ERROR_NETWORK                   = -2,    /* ç½‘络连接错误 */
    SMPC_QUICK_SDK_ERROR_CHECKFAILED               = -3,    /* ç™»å½•校验失败 */
    SMPC_QUICK_SDK_ERROR_CHECKLOGINING             = -4,    /* æ­£åœ¨æ ¡éªŒç™»å½• */
    SMPC_QUICK_SDK_ERROR_LOGINDISABLED             = -5,    /* æ¸ é“禁止登录 */
    SMPC_QUICK_SDK_ERROR_PARAM                     = -10,   /* å‚数错误 */
    SMPC_QUICK_SDK_ERROR_NOT_INIT                  = -20,   /* è¿˜æ²¡æœ‰åˆå§‹åŒ– */
    SMPC_QUICK_SDK_ERROR_INIT_FAILED               = -21,   /* åˆå§‹åŒ–失败*/
    SMPC_QUICK_SDK_ERROR_UNSUPPORTED               = -100,  /* åŠŸèƒ½ä¸è¢«æ”¯æŒ */
    SMPC_QUICK_SDK_ERROR_NOT_LOGIN                 = -301,  /* æ²¡æœ‰ç™»å½•用户 */
    SMPC_QUICK_SDK_ERROR_HAD_LOGIN                 = -302,  /* å·²æœ‰ç™»å½•用户 */
    SMPC_QUICK_SDK_ERROR_LOGOUT_FAIL               = -303,  /* ç”¨æˆ·ç™»å‡ºå¤±è´¥ */
    SMPC_QUICK_SDK_ERROR_RECHARGE_FAILED           = -400,  /* å……值失败 */
    SMPC_QUICK_SDK_ERROR_RECHARGE_CANCELLED        = -401,  /* ç”¨æˆ·å……值取消 */
}SMPC_QUICK_SDK_ERROR_CODE;
typedef enum {
    SMPC_QUICK_SDK_FUNC_TYPE_CPSCHANNELID      = 0, /*官方渠道cps渠道id*/
    SMPC_QUICK_SDK_FUNC_TYPE_PAUSED_GAME       = 1, /*暂停游戏*/
    SMPC_QUICK_SDK_FUNC_TYPE_ENTER_USER_CENTER = 2, /*进入用户中心*/
    SMPC_QUICK_SDK_FUNC_TYPE_ENTER_BBS         = 3, /*进入论坛*/
//    SMPC_QUICK_SDK_FUNC_TYPE_OPEN_URL          = 4,
    SMPC_QUICK_SDK_FUNC_TYPE_SHOW_TOOLBAR      = 5, /*显示浮动工具栏*/
    SMPC_QUICK_SDK_FUNC_TYPE_HIDE_TOOLBAR      = 6, /*隐藏浮动工具栏*/
    SMPC_QUICK_SDK_FUNC_TYPE_ENTER_CUSTOMER_CENTER = 7, /*进入客服中心*/
}SMPC_QUICK_SDK_FUNC_TYPE;
#endif
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKGameRoleInfo.h
New file
@@ -0,0 +1,31 @@
//
//  SMPCQuickSDKGameRoleInfo.h
//  SMPCQuickSDK
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface SMPCQuickSDKGameRoleInfo : NSObject
NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *serverId;         //服务器Id,必填
@property (nonatomic,copy) NSString *serverName;       //服务器名称,必填
@property (nonatomic,copy) NSString *gameRoleName;     //角色名,必填
@property (nonatomic,copy) NSString *gameRoleID;       //角色ID,必填
@property (nonatomic, copy) NSString * creatTime;      //角色创建时间(10位时间戳),必填,没有传0
NS_ASSUME_NONNULL_END
@property (nonatomic,copy) NSString * _Nullable gameUserBalance;  //玩家虚拟货币余额,选填,默认值0
@property (nonatomic,copy) NSString * _Nullable vipLevel;         //玩家vip等级,选填,默认值0
@property (nonatomic,copy) NSString * _Nullable gameUserLevel;    //玩家等级,选填,默认值0
@property (nonatomic,copy) NSString * _Nullable partyName;        //公会名称,选填,默认空字符串
@property (nonatomic,copy) NSString * _Nullable partyId;        //公会id,选填,默认空字符串
@property (nonatomic, copy) NSString * _Nullable fightPower;     //战力,选填,默认值0
@property (nonatomic, copy) NSString * _Nullable professionId;     //角色职业id, é€‰å¡«ï¼Œé»˜è®¤å€¼ï¼Œç©ºå­—符串
@property (nonatomic, copy) NSString * _Nullable profession;     //角色职业, é€‰å¡«ï¼Œé»˜è®¤å€¼ï¼Œç©ºå­—符串
@property (nonatomic,copy) NSString * _Nullable roleGender;        //角色性别,选填,默认值男
@property (nonatomic,copy) NSString * _Nullable partyRoleId;        //公会角色id,选填,默认空字符串
@property (nonatomic,copy) NSString * _Nullable partyRoleName;        //公会角色名,选填,默认空字符串
@end
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKInitConfigure.h
New file
@@ -0,0 +1,17 @@
//
//  SMPCQuickSDKInitConfigure.h
//  SMPCQuickSDK
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface SMPCQuickSDKInitConfigure : NSObject
@property (nonatomic, copy) NSString *productCode;  //QuickSDK提供的 product_code
@property (nonatomic, copy) NSString *productKey;   //QuickSDK提供的 product_token
@end
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKPayOrderInfo.h
New file
@@ -0,0 +1,27 @@
//
//  SMPCQuickSDKPayOrderInfo.h
//  SMPCQuickSDK
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface SMPCQuickSDKPayOrderInfo : NSObject
@property(nonatomic,copy) NSString *goodsID;    //商品ID IAP时为苹果开发者后台配置的商品id,必填
@property(nonatomic,copy) NSString *productName;  //商品名称,必填
@property(nonatomic,copy) NSString *cpOrderID;  //游戏订单ID,必填
@property(nonatomic,assign) NSUInteger count;     //商品数量,必填
@property(nonatomic,assign) float amount;         //商品总价,必填,这个很重要
@property(nonatomic,copy) NSString *callbackUrl;  //购买回调地址,选填,优先使用服务器端配置的
@property(nonatomic,copy) NSString *extrasParams; //透传字段,选填,服务器回调原样传递
//deprecated åºŸå¼ƒçš„,可以不传值
@property(nonatomic,assign) float price;          //商品单价,选填,如果渠道需要,Quick将通过总价和数量来计算
@property(nonatomic,copy) NSString *productDesc;   //商品描述,选填,默认QuickSDK使用“数量+商品名称“拼接,如果数量为1,使用商品名称
@property(nonatomic,copy) NSString *quantifier;     //商品量词,选填,可以为@""空串
+ (instancetype)info;//获取一个对象属性值为nil,数值属性为0的实例
@end
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/Headers/SMPCQuickSDKShareInfo.h
New file
@@ -0,0 +1,28 @@
//
//  SMPCQuickSDKShareInfo.h
//  SMPCQuickSDK
//
//  Created by xiaoxiao on 2019/2/19.
//
#import <Foundation/Foundation.h>
@interface SMPCQuickSDKShareInfo : NSObject
@property (nonatomic, strong) NSString *type;   //分享类型 1.facebook分享连接 2.facebook分享图片 3.微信分享文本 4.微信分享图片
@property (nonatomic, strong) NSString *title;   //分享标题
@property (nonatomic, strong) NSString *content;   //分享内容
@property (nonatomic, strong) NSString *imgPath;   //分享图片本地地址
@property (nonatomic, strong) NSString *filePath;   //分享文件路径
@property (nonatomic, strong) NSString *imgUrl;   //分享图片网络地址
@property (nonatomic, strong) NSString *sencetype;   //发送场景 0 èŠå¤©ç•Œé¢ï¼Œ1 æœ‹å‹åœˆï¼Œ2 æ”¶è—
@property (nonatomic, strong) NSString *url;   //分享链接
@property (nonatomic, strong) NSString *shareTo;   //分享到哪里
@property (nonatomic, strong) NSString *extenal;   //额外备注
@property (nonatomic, assign) float width;  //缩略图宽
@property (nonatomic, assign) float height;   //缩略图高
@end
Channel/IOS/qkbt10game/Plugins/QuickSDK/SMPCQuickSDK.framework/SMPCQuickSDK
Binary files differ
Channel/IOS/qkbt10game/Plugins/QuickSDK/libSMPCQuickChannel.a
Binary files differ
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/The2thWorldRES.bundle/TY_AN_34.png
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/The2thWorldRES.bundle/The2thWorldSDKConfig.plist
New file
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>JPush_AppKey</key>
    <string>111a5f817592ddc68edc802c</string>
    <key>TTTrack_AppID</key>
    <string>155761</string>
    <key>TrackingIO_AppKey</key>
    <string>12aef4c284c6996703765fe9f7422428</string>
</dict>
</plist>
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/UniversalSDK.h
New file
@@ -0,0 +1,80 @@
//
//  UniversalSDK.h
//  Unity-iPhone
//
//  Created by è”¡ç€š on 2018/4/24.
//
#ifndef __UNIVERSALSDK_H_
#define __UNIVERSALSDK_H_
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#define UNITY_OBJ_NAME "SDKUtility"
#define UNITY_FUNC_NAME "HandleSdkMessage"
#define PRODUCT_CODE    @"72370591950776269390310300899797"
#define PRODUCT_KEY     @"92498417"
#define S2U_BatteryLevel                1
#define S2U_BatteryCharging             2
#define S2U_SdkInitComplete             3
#define S2U_DeviceInfo                  4
#define S2U_PushClientID                5
#define S2U_FreePlatformInitOk          100
#define S2U_FreePlatformInitFail        101
#define S2U_FreePlatformLoginOk         102
#define S2U_FreePlatformLoginFail       103
#define S2U_FreePlatformLoginCancel     104
#define S2U_FreePlatformLogoutOk        105
#define S2U_FreePlatformLogoutFail      106
#define S2U_FreePlatformSwitchAccountOk 107
#define S2U_FreePlatformPayOk           108
#define S2U_FreePlatformPayFail         109
#define S2U_FreePlatformPayCancel       110
#define S2U_FreePlatformRegisterOk      111
#define U2S_BatteryListenStart          1
#define U2S_BatteryListenStop           2
#define U2S_CopyContent                 7
#define U2S_OpenWebView                 8
#define U2S_Init                        9
#define U2S_FreePlatformInit            100
#define U2S_FreePlatformLogin           101
#define U2S_FreePlatformLogout          102
#define U2S_FreePlatformSwitchAccount   103
#define U2S_FreePlatformPay             104
#define U2S_PayFinished                 105
#define U2S_CreateRole                  106
#define U2S_RoleLogin                   107
#define U2S_RoleLevelUp                 108
#define U2S_JPushAddLocalMessage        200
#define U2S_JPushRemoveLocalMessage     201
#define U2S_MakeKeyAndVisible           300
#define U2S_SendRegistEvent             500
#define U2S_SendLoginEvent              600
#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
static BOOL     JPush_IsProduction = FALSE;
@interface UniversalSDK : NSObject<WKUIDelegate, WKNavigationDelegate> {
    WKWebView* m_UIWebView;
    WKWebView* m_fakeUIWebView;
    UIButton* m_CloseBtn;
}
-(void) HandleUnityMessage:(NSString*) json;
-(void) Init;
-(id) APNativeJSONObject:(NSData*) data;
-(NSData*) APNativeJSONData:(id) obj;
-(void) RemoveLocalNotificationWithIdentifierKey:(NSString*) idKey;
-(void) QuickSDKInit:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
@end
#endif
Channel/IOS/qkbt10game/Plugins/The2thWorldSDK/UniversalSDK.mm
New file
@@ -0,0 +1,585 @@
//
//  UniversalSDK.m
//  Unity-iPhone
//
//  Created by è”¡ç€š on 2018/4/24.
//
#import "UniversalSDK.h"
#import "AdSupport/AdSupport.h"
#import "opus.h"
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
#import <UserNotifications/UserNotifications.h>
#endif
#import "SystemConfiguration/CaptiveNetwork.h"
#import <SMPCQuickSDK/SMPCQuickSDK.h>
@implementation UniversalSDK
#define CHANNEL_NUM 1
static int s_frequency = 16000;
static int s_bitRate = 20000;
static int s_bandMode = OPUS_BANDWIDTH_WIDEBAND;
static int s_frameSize = 160;
static int sBatteryLevel = -1;
static int sBatteryState = -1;
static NSString* sAppID;
static NSString* sGameID;
static NSString* sUserName;
static NSThread* _thread;
static NSString* channel;
-(id)init
{
     self = [super init];
     m_fakeUIWebView = [[WKWebView alloc] initWithFrame:CGRectZero];
     NSURL *url = [NSURL URLWithString:@"www.baidu.com"];
     NSURLRequest *request = [NSURLRequest requestWithURL:url
                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                           timeoutInterval:10.f];
     [m_fakeUIWebView loadRequest:request];
     return self;
}
-(void) Init
{
    UIDevice *_device = [UIDevice currentDevice];
    _device.batteryMonitoringEnabled = true;
    NSString* _uniqueID = [[NSUserDefaults standardUserDefaults] objectForKey:@"tsw_unique_id"];
    //获取IDFA
    NSString* _idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
    if(_uniqueID == NULL || [_uniqueID length] <= 0)
    {
        //判断IDFA是否为空
        BOOL isEmpty = [[_idfa stringByReplacingOccurrencesOfString:@"-" withString:@""] stringByReplacingOccurrencesOfString:@"0" withString:@""].length;
        if (isEmpty) {
            //不为空,将IDFA作为唯一标识
            _uniqueID = _idfa;
        }
        else {
            //为空,获取UUID作为唯一标识
            _uniqueID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
        }
        //保存唯一设备标识,如已存在则不进行任何处理
        [[NSUserDefaults standardUserDefaults] setObject:_uniqueID forKey:@"tsw_unique_id"];
        [[NSUserDefaults standardUserDefaults] synchronize];
    }
    // å–å¾—UserAgent
    [m_fakeUIWebView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id _Nullable userAgent, NSError * _Nullable error) {
        NSLog(@"%@", userAgent);
        NSString* _userAgent = [NSString stringWithFormat:@"%@", userAgent];
        // å‘送设备信息
        NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                      _uniqueID,@"unique_id",
                                      _idfa,@"android_id",
                                      [NSNumber numberWithInt:S2U_DeviceInfo],@"code",
                                      _userAgent,@"userAgent",nil];
        [self SendMessageToUnity:_dict];
        }];
}
-(void)SendMessageToUnity:(NSDictionary*)dict
{
    BOOL _result = [NSJSONSerialization isValidJSONObject:dict];
    if(_result)
    {
        NSData* _jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:NULL];
        UnitySendMessage(UNITY_OBJ_NAME, UNITY_FUNC_NAME,
                         [[[NSString alloc] initWithData:_jsonData encoding:NSUTF8StringEncoding] UTF8String]);
    }
}
-(void) BatteryThread {
    while (TRUE)
    {
        [NSThread sleepForTimeInterval:1];
        UIDevice *_device = [UIDevice currentDevice];
        int _state = [_device batteryState];
        if(_state != sBatteryState){
            sBatteryState = _state;
            NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:
                                   [NSNumber numberWithInt:sBatteryState], @"status",
                                   [NSNumber numberWithInt:S2U_BatteryCharging], @"code", nil];
            [self SendMessageToUnity:_dict];
        }
        int _level = (int)([_device batteryLevel] * 100);
        if(_level != sBatteryLevel){
            sBatteryLevel = _level;
            NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:
                                   [NSNumber numberWithInt:sBatteryLevel], @"level",
                                   [NSNumber numberWithInt:S2U_BatteryLevel], @"code", nil];
            [self SendMessageToUnity:_dict];
        }
    }
}
-(void) OpenURL:(NSString*) url {
    if(m_UIWebView != NULL) {
        [self btnClick:NULL];
        return;
    }
    CGRect _bounds = UnityGetMainWindow().bounds;
    float _scale = _bounds.size.width / 1334;
    float _width = 982 * _scale;
    float _height = 560 * _scale;
    float _offsetX = (_bounds.size.width - _width) * .5f;
    float _offsetY = (_bounds.size.height - _height) * .5f;
    m_UIWebView = [[WKWebView alloc] initWithFrame:CGRectMake(_offsetX, _offsetY, _width, _height)];
    m_UIWebView.UIDelegate = self;
    m_UIWebView.navigationDelegate = self ;
    m_UIWebView.scrollView.scrollEnabled = YES;
    m_UIWebView.scrollView.bounces = NO;
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:url]];
    [m_UIWebView loadRequest:request];
}
-(void) btnClick:(UIButton*)sender {
    [m_CloseBtn removeFromSuperview];
    [m_CloseBtn removeTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    m_CloseBtn = NULL;
    NSURLCache *_cache = [NSURLCache sharedURLCache];
    [_cache removeAllCachedResponses];
    [_cache setDiskCapacity:0];
    [_cache setMemoryCapacity:0];
    [m_UIWebView removeFromSuperview];
    m_UIWebView = NULL;
}
//-(void)webViewDidFinishLoad:(WKWebView *)webView{
- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation{
    CGRect _bounds = UnityGetMainWindow().bounds;
    float _scale = _bounds.size.width / 1334;
    float _width = 982 * _scale;
    float _height = 560 * _scale;
    m_CloseBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [m_CloseBtn setFrame:CGRectMake(_width - 600 * _scale, _height - 86 * _scale, 360 * _scale, 72 * _scale)];
    [m_CloseBtn setTitle:@"我知道了" forState:UIControlStateNormal];
    NSString *_bundlePath = [[NSBundle mainBundle] pathForResource:@"The2thWorldRES.bundle" ofType:nil];
    NSBundle *_bundle = [NSBundle bundleWithPath:_bundlePath];
    NSString *pic1Path = [_bundle pathForResource:@"TY_AN_34.png" ofType:nil];
    [m_CloseBtn setBackgroundImage:[UIImage imageWithContentsOfFile:pic1Path] forState:UIControlStateNormal];
    [m_CloseBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [m_CloseBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [m_UIWebView addSubview:m_CloseBtn];
    UIView *view = UnityGetGLViewController().view;
    [view addSubview:m_UIWebView];
}
-(void)QuickSDKInit:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // ç›‘听初始化
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(smpcQpInitResult:)
                                                 name:kSmpcQuickSDKNotiInitDidFinished
                                               object:nil];
    // ç›‘听登录
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpLoginResult:) name:kSmpcQuickSDKNotiLogin object:nil];
    // ç›‘听注销
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpLogoutResult:) name:kSmpcQuickSDKNotiLogout object:nil];
    // ç›‘听充值结果
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpRechargeResult:) name:kSmpcQuickSDKNotiRecharge object:nil];
    // --------------------- åˆå§‹åŒ– --------------------------
    SMPCQuickSDKInitConfigure *cfg = [[SMPCQuickSDKInitConfigure alloc] init];
    cfg.productKey = PRODUCT_KEY;
    cfg.productCode = PRODUCT_CODE;
    [[SMPCQuickSDK defaultInstance] initWithConfig:cfg application:application didFinishLaunchingWithOptions:launchOptions];
    // ------------------------------------------------------
}
- (void)smpcQpInitResult:(NSNotification *)notify {
    NSLog(@"init result:%@",notify);
    NSDictionary *userInfo = notify.userInfo;
    int errorCode = [userInfo[kSmpcQuickSDKKeyError] intValue];
    switch (errorCode) {
        case SMPC_QUICK_SDK_ERROR_NONE:
        {
            NSLog(@"初始化成功");
//            NSString *_appid = [[SMPCQuickSDK defaultInstance] getConfigValue:@"zfappid"];
//            if (_appid == nil || [_appid isEqualToString:@""])
//            {
//                _appid = sAppID;
//            }
            NSString *_appid = sAppID;
            NSLog(@"init _appid:%@",_appid);
            NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                          [NSNumber numberWithInt:S2U_SdkInitComplete], @"code",
                                          @"quick", @"channelPlatform",
                                          _appid, @"yj_appid", _appid, @"yj_spid", nil];
            [self SendMessageToUnity:_dict];
        }
            break;
        case SMPC_QUICK_SDK_ERROR_INIT_FAILED:
        default:
        {
            //初始化失败
            NSLog(@"渠道初始化失败");
        }
            break;
    }
}
- (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) {
        return nil;
    }
    NSError *error = nil;
    id retId = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
    if (error) {
        NSLog(@"%s trans data to obj with error: %@", __func__, error);
        return nil;
    }
    return retId;
}
-(void)HandleUnityMessage:(NSString *)json {
    NSLog(@"收到Unity发来的消息 => %@", json);
    NSData *_jsonData = [json dataUsingEncoding:NSUTF8StringEncoding];
    NSDictionary *_dict = [self APNativeJSONObject:_jsonData];
    switch([[_dict objectForKey:@"code"] intValue]){
        case U2S_Init:
            sAppID = _dict[@"appID"];
            sGameID = _dict[@"gameID"];
            [self Init];
            break;
        case U2S_CopyContent:
            [UIPasteboard generalPasteboard].string = _dict[@"content"];
            break;
        case U2S_FreePlatformInit:
            break;
        case U2S_MakeKeyAndVisible:
        {
            UIWindow * _window = [[UIApplication sharedApplication].delegate window];
            if (_window != nil && _window.rootViewController != nil) {
                [_window makeKeyAndVisible];
            }
        }
            break;
        case U2S_OpenWebView:
            [self OpenURL:_dict[@"url"]];
            break;
        case U2S_FreePlatformLogin:
        {
            int error = [[SMPCQuickSDK defaultInstance] login];
            if (error != 0) {
                NSLog(@"U2S_FreePlatformLogin => %d",error);
            }
        }
            break;
        case U2S_FreePlatformLogout:
        {
            [[SMPCQuickSDK defaultInstance] logout];
        }
            break;
        case U2S_CreateRole:
        {
            // æ›´æ–°è§’色信息
            SMPCQuickSDKGameRoleInfo *gameRoleInfo = [SMPCQuickSDKGameRoleInfo new];
            gameRoleInfo.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]];
            gameRoleInfo.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]];
            gameRoleInfo.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //需要是数字字符串
            gameRoleInfo.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]];
            gameRoleInfo.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]];
            gameRoleInfo.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]];
            gameRoleInfo.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]];
            gameRoleInfo.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]];
            gameRoleInfo.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]];
            [[SMPCQuickSDK defaultInstance] updateRoleInfoWith:gameRoleInfo isCreate:YES];//如果这个角色是刚刚创建的,这里isCreate可以传YES
            break;
        }
        case U2S_RoleLogin:
        {
            // æ›´æ–°è§’色信息
            SMPCQuickSDKGameRoleInfo *gameRoleInfo = [SMPCQuickSDKGameRoleInfo new];
            gameRoleInfo.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]];
            gameRoleInfo.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]];
            gameRoleInfo.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //需要是数字字符串
            gameRoleInfo.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]];
            gameRoleInfo.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]];
            gameRoleInfo.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]];
            gameRoleInfo.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]];
            gameRoleInfo.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]];
            gameRoleInfo.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]];
            [[SMPCQuickSDK defaultInstance] updateRoleInfoWith:gameRoleInfo isCreate:NO];//如果这个角色是刚刚创建的,这里isCreate可以传YES
            break;
        }
        case U2S_RoleLevelUp:
        {
            // æ›´æ–°è§’色信息
            SMPCQuickSDKGameRoleInfo *gameRoleInfo = [SMPCQuickSDKGameRoleInfo new];
            gameRoleInfo.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]];
            gameRoleInfo.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]];
            gameRoleInfo.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //需要是数字字符串
            gameRoleInfo.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]];
            gameRoleInfo.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]];
            gameRoleInfo.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]];
            gameRoleInfo.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]];
            gameRoleInfo.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]];
            gameRoleInfo.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]];
            [[SMPCQuickSDK defaultInstance] updateRoleInfoWith:gameRoleInfo isCreate:NO];//如果这个角色是刚刚创建的,这里isCreate可以传YES
            break;
        }
        case U2S_FreePlatformPay:
        {
            SMPCQuickSDKGameRoleInfo *role = [[SMPCQuickSDKGameRoleInfo alloc] init];
            SMPCQuickSDKPayOrderInfo *order = [[SMPCQuickSDKPayOrderInfo alloc] init];
            role.serverName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"serverName"]];
            role.gameRoleName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleName"]];
            role.serverId = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"sid"]]; //需要是数字字符串
            role.gameRoleID = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"roleID"]];
            role.gameUserBalance = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"money"]];
            role.vipLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"vipLevel"]];
            role.gameUserLevel = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"level"]];
            role.partyName = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"familyName"]];
            role.creatTime = [NSString stringWithFormat:@"%@",[_dict objectForKey:@"createTime"]];
            order.goodsID = [NSString stringWithFormat:@"%@", [_dict objectForKey:@"cpInfo"]]; //必填 iap时注意和苹果开发者后台一致,或者渠道映射的
            order.productName = [NSString stringWithFormat:@"%@", [_dict objectForKey:@"title"]];//必填
            order.cpOrderID = [NSString stringWithFormat:@"%@", [_dict objectForKey:@"orderId"]]; //必填 æ¸¸æˆè®¢å•号
            order.count = 1;  //必填 æ•°é‡
            order.amount = [[_dict objectForKey:@"mount"] floatValue]; //必填 æ€»ä»·
//            NSString *_appid = [[SMPCQuickSDK defaultInstance] getConfigValue:@"zfappid"];
//            if (_appid == nil || [_appid isEqualToString:@""])
//            {
//                _appid = sAppID;
//            }
            NSString *_appid = sAppID;
            order.extrasParams = [NSString stringWithFormat:@"{\"appid\":\"%@\",\"cpinfo\":\"%@\",\"cporderid\":\"%@\",\"serverid\":\"%@\",\"channelID\":\"%@\"}",
                                  _appid,
                                  [_dict objectForKey:@"cpInfo"],
                                  [_dict objectForKey:@"orderId"],
                                  [_dict objectForKey:@"sid"],
                                  channel
                                  ];
//            //个别渠道要求单价*数量==总价
//            if([SMPCQuickSDK defaultInstance].channelType == 9999){
//                //通过判断渠道号处理特定渠道的参数
//                order.goodsID = @"productlist.name";
//            }
            int error = [[SMPCQuickSDK defaultInstance] payOrderInfo:order
                                                            roleInfo:role];
            if (error!=0)
                NSLog(@"%d", error);
        }
            break;
        case U2S_BatteryListenStart:
            if(_thread == NULL)
            {
                _thread = [[NSThread alloc] initWithTarget:self selector:@selector(BatteryThread) object:nil];
                [_thread setName:@"BatteryCheck"];
            }
            if(![_thread isExecuting])
            {
                [_thread start];
            }
            break;
        case U2S_BatteryListenStop:
            break;
    }
}
@end
extern "C" void native_opus_init(int frequency, int bitRate, int bandMode)
{
    s_frequency = frequency;
    s_bandMode = bandMode;
    s_bitRate = bitRate;
    s_frameSize = frequency / 100;
}
extern "C" int native_opus_encode(opus_int16 *pcm, int len, unsigned char *opus)
{
    int errorCode = 0;
    opus_int32 skip = 0;
    OpusEncoder *enc = opus_encoder_create(s_frequency, CHANNEL_NUM, OPUS_APPLICATION_VOIP, &errorCode);
    if (OPUS_OK != errorCode) {
        enc = NULL;
        return -1;
    }
    opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(s_bandMode));
    opus_encoder_ctl(enc, OPUS_SET_BITRATE(s_bitRate));
    opus_encoder_ctl(enc, OPUS_SET_VBR(1));
    opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(10));
    opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(0));
    opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(OPUS_SIGNAL_VOICE));
    opus_encoder_ctl(enc, OPUS_SET_DTX(0));
    opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(0));
    opus_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&skip));
    opus_encoder_ctl(enc, OPUS_SET_LSB_DEPTH(16));
    unsigned char *rbytes = opus;
    opus_int16 *frame = pcm;
    int totalSize = 0;
    while (len >= s_frameSize)
    {
        opus_int32 length = opus_encode(enc, frame, s_frameSize, rbytes + sizeof(char), s_bitRate);
        rbytes[0] = length;
        frame += s_frameSize;
        rbytes += length + sizeof(char);
        len -= s_frameSize;
        totalSize += (length+1);
    }
    opus_encoder_destroy(enc);
    return totalSize;
}
extern "C" int native_opus_decode(unsigned char *opus, int len, short *pcm)
{
    int err = 0;
    //opus_int32 skip = 0;
    OpusDecoder *dec = opus_decoder_create(s_frequency, CHANNEL_NUM, &err);
    if (err != OPUS_OK) {
        dec = NULL;
        return -1;
    }
    while (len > 0)
    {
        int frame_opus_length = opus[0];
        int length = opus_decode(dec, opus + sizeof(char), frame_opus_length, pcm, s_frameSize, 0);
        opus += sizeof(char) + frame_opus_length;
        pcm += s_frameSize;
        len = len - frame_opus_length - sizeof(char);
    }
    opus_decoder_destroy(dec);
    return 0;
}
ÐÂÔöÇþµÀ.txt
@@ -8,7 +8,7 @@
2.ios
    è·¯å¾„ U3DRepository\Channel\IOS
  a. æ‹·è´ä¸€ä»½å‚考- æ”¹æ¸ é“名
  b. æ›¿æ¢ code和key,如有逻辑变更根据需求修改
  b. UniversalSDK.h替换 code和key,如有逻辑变更根据需求修改
  c. èµ°æ‰“包流程
quicksdk更新