Swift SDK

2022-09-09  本文已影响0人  爆炸的白菜君

注册SDK
gameId --> HY_APPID
gamekey --> HY_APPKEY
g_login_c_id --> GoogleSignInClientID
g_login_c_id --> UIApplication

+ (void)initRGTYSDKActionWithGameId:(NSString * _Nonnull)gameId gamekey:(NSString * _Nonnull)gamekey g_login_c_id:(NSString * _Nonnull)g_login_c_id app:(UIApplication * _Nonnull)app SWIFT_METHOD_FAMILY(none);

弹窗登录
name --> 无用参数,可以传角色名
callback_s --> 登录成功回调
callback_f --> 登录成功回调
pwd --> 无用参数,随便传

+ (void)signinActionWithName:(NSString * _Nonnull)name callback_s:(void (^ _Nonnull)(NSDictionary<NSString *, NSString *> * _Nonnull))callback_s callback_f:(void (^ _Nonnull)(NSString * _Nonnull))callback_f pwd:(NSString * _Nonnull)pwd;

支付
o_id --> 订单Id
z_id --> 区服Id
z_name --> 区服名称
t_info --> 无用参数,随便传
r_Id --> 角色Id
r_name --> 角色名称
r_level --> 角色等级
r_num --> 无用参数,随便传
p_id --> 商品ID
callback_1 --> 购买成功回调
callback_2 --> 购买失败回调

+ (void)userpayRequestWithO_id:(NSString * _Nonnull)o_id z_id:(NSString * _Nonnull)z_id z_name:(NSString * _Nonnull)z_name t_info:(NSString * _Nonnull)t_info r_Id:(NSString * _Nonnull)r_Id r_name:(NSString * _Nonnull)r_name r_level:(NSString * _Nonnull)r_level r_num:(CGFloat)r_num p_id:(NSString * _Nonnull)p_id callback_1:(void (^ _Nonnull)(NSString * _Nonnull))callback_1 callback_2:(void (^ _Nonnull)(NSString * _Nonnull))callback_2;

App打开了外部链接,谷歌登录回调触发

+ (BOOL)appInWithURLWithUrlContent:(NSURL * _Nonnull)urlContent SWIFT_WARN_UNUSED_RESULT;



案例
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{
    
    return [RGTYSDK appInWithURLWithUrlContent:url];
    
}

游戏进入前台

+ (void)appDidForgroundActive;

案例
- (void)applicationDidBecomeActive:(UIApplication *)application {
    [RGTYSDK appDidForgroundActive];
}

游戏进入后台

+ (void)appDidInactive;

案例
- (void)applicationDidEnterBackground:(UIApplication *)application{
    [RGTYSDK appDidInactive];
}

跳转设置界面
time --> 无用参数,传当前时间戳
callback1--> 获取第三方账号的回调
callback1--> 切换账号
callback1--> 注销账号
otherInfo --> 无用参数,随便传

+ (void)gotoSettingActionWithTime:(NSTimeInterval)time callback1:(void (^ _Nonnull)(NSString * _Nonnull))callback1 callback2:(void (^ _Nonnull)(NSString * _Nonnull))callback2 callback3:(void (^ _Nonnull)(void))callback3 otherInfo:(NSString * _Nonnull)otherInfo;

角色上报
vipNum --> VIP等级
t_info --> 无用参数,随便传
z_id --> 区服id
z_name --> 区服名称
r_id --> 角色ID
r_level --> 角色等级
r_name --> 角色名称
w_p --> 战力
r_f --> 阵营
age --> 无用参数,随便传

+ (void)open_R_infoWithVipNum:(NSInteger)vipNum t_info:(NSString * _Nonnull)t_info z_id:(NSString * _Nonnull)z_id z_name:(NSString * _Nonnull)z_name r_id:(NSString * _Nonnull)r_id r_level:(NSInteger)r_level r_name:(NSString * _Nonnull)r_name w_p:(NSInteger)w_p r_f:(NSInteger)r_f age:(NSInteger)age;

获取绑定账号的列表
callback_1 -->获取成功的回调
callback_2 -->获取失败的回调

+ (void)otherAccountActionWithCallback_1:(void (^ _Nonnull)(NSDictionary<NSString *, NSNumber *> * _Nonnull))callback_1 callback_2:(void (^ _Nonnull)(NSString * _Nonnull))callback_2;

静默登录
token --> 无用参数,随便传
callback_1 --> 登录成功的回调
callback_2 -->登录失败的回调

+ (void)gameAutoSignActionWithToken:(NSString * _Nonnull)token callback_1:(void (^ _Nonnull)(NSDictionary<NSString *, id> * _Nonnull))callback_1 callback_2:(void (^ _Nonnull)(NSString * _Nonnull))callback_2;

收到了远程推送

+ (void)appReceiveRNotificationActionWithData:(NSDictionary<NSString *, id> * _Nonnull)data;

案例
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
    
    NSLog(@"%@", userInfo);
    [RGTYSDK appReceiveRNotificationActionWithData:userInfo];
    
    completionHandler(UIBackgroundFetchResultNewData);
}

注册推送需要的DeviceToken

+ (void)appRegisterRNDeviceTokenWithToken:(NSData * _Nonnull)token;

案例
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
    [RGTYSDK appRegisterRNDeviceTokenWithToken:deviceToken];
}

CP事件统计

+ (void)gameCPCustomAdjustActionWithEname:(NSString * _Nonnull)Ename;

案例
[RGTYSDK gameCPCustomAdjustActionWithEname:@"c1"];

获取商品本地化的金额
productIdArr --> 商品id的数组
callback_1 -->成功的回调
callback_2 --> 失败的回调

+ (void)gameProductPriceRequestWithProductIdArr:(NSArray<NSString *> * _Nonnull)productIdArr callback_1:(void (^ _Nonnull)(NSArray<NSDictionary<NSString *, NSString *> *> * _Nonnull))callback_1 callback_2:(void (^ _Nonnull)(NSString * _Nonnull))callback_2;
上一篇 下一篇

猜你喜欢

热点阅读