iOS SDK_第三方SDK关联
GAMEPOT iOS SDK支持与第三方SDK关联。
第三方SDK登录关联
如要通过第三方SDK关联使用登录功能,请参考表的内容在下列参数输入值后使用代码。
参数及代码
参数名
是否必需
类型
概述
viewController
必填
UIViewController
当前ViewController
userid
必填
NSString
用户唯一ID
success
必填
String
成功时回调
fail
必填
String
失败时回调
update
选择
String
更新功能运行时回调
maintenance
选择
String
检查功能运行时回调
NSString userid = @"memberid of 3rd party sdk";
[[GamePotChannel getInstance] loginByThirdPartySDK:self uId:userid success:^(GamePotUserInfo* userInfo) {
// 登录成功。请根据游戏逻辑进行处理。
} cancel:^{
// 用户取消登录
} fail:^(NSError *error) {
// 登录失败。请使用[error localizedDescription]显示错误消息。
} update:^(GamePotAppStatus *appStatus) {
// 需强制更新。调用以下API,即可显示SDK自主弹窗。
// 需要自定义时,在没有调用以下API的状态下进行自定义。
[[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
setCloseHandler:^{
// 调用showAppStatusPopup API时,在必须关闭应用的情况下调用。
// 请处理终止进程。
} setNextHandler:^(NSObject* resultPayload) {
// 将仪表盘的更新设置设为推荐时,会显示"下次进行"按钮。
// 用户选择该按钮时会调用。
// 请使用resultPayload信息,进行与登录成功时同样的处理。
// GamePotUserInfo* userInfo = (GamePotUserInfo*)resultPayload;
}];
} maintenance:^(GamePotAppStatus *appStatus) {
// 正在维护中。调用以下API,即可显示SDK自主弹窗。
// 正在维护中。调用以下API,即可显示SDK自主弹窗。
[[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
setCloseHandler:^{
// 调用showAppStatusPopup API时,在必须关闭应用的情况下调用。
// 请处理终止进程。
}];
}];
第三方SDK支付关联
如要通过第三方SDK关联使用支付功能,请参考表的内容在下列代码输入参数值后使用代码。
参数及代码
参数名
是否必需
类型
概述
productid
必填
NSString
在仪表盘添加的道具ID
transactionid
必填
NSString
付费发票号(GPA-xxx-xxxx-xxxx)
currency
选择
NSString
货币(KRW、USD)
price
选择
NSDecimalNumber
付费道具的金额
paymentid
选择
NSString
支付商店(apple
)
success
选择
GamePotCommonSuccess
成功时回调
fail
选择
GamePotCommonFail
失败时回调
NSString* productId = @"purchase_001";
NSString* transactionId = @"xxxxxxxxxxx";
NSString* currency = @"USD";
NSDecimalNumber* price = [[NSDecimalNumber alloc] initWithString:@"1.09"];
NSString* paymentId = "apple";
NSString* uniqueId = "developer unique id";
[[GamePot getInstance] sendPurchaseByThirdPartySDK:productId transactionId:transactionId currency:currency price:price paymentId:paymentId uniqueId:uniqueId success:^{
// success
} fail:^(NSError *error) {
// fail
}];
Last updated