Blame view
doc/IOSDocument.md
1.64 KB
|
d6a208e3c
|
1 2 3 4 5 6 7 8 9 10 |
# Gump IOS SDK使用文档
接入手册
V
2015年02月13日
## 1、添加动态库
|
|
d392082b9
|
11 |
在工程里添加MobileCoreServices.framework、SystemConfiguration.framework、libz.dylib、CFNetwork.framework、libletsgame.a |
|
d6a208e3c
|
12 13 14 15 16 17 18 19 |
## 2、设置头文件搜索路径 头文件只有LetsGameAPI.h和LSGAccount.h两个文件,引入头文件,并设置搜索路径。 ## 3、添加资源文件 在工程里添加letsgame.bundle资源文件,里面包含图片及相关语言包 |
|
d392082b9
|
20 |
## 4、在工程里添加SDK登录代码 |
|
d6a208e3c
|
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
[LetsGameAPI instance].appId = @"100"; // 设置appId
[LetsGameAPI instance].appKey = @"100"; // 设置appKey
[[LetsGameAPI instance] showLoginView]; // 弹出登录页面
// 登录成功回调
[LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) {
NSLog(@"%@", [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %d", userId, sessionKey, type]);
};
// 登录失败回调
[LetsGameAPI instance].dismissBlock = ^() {
NSLog(@"dismiss without login");
};
|
|
d392082b9
|
36 37 38 39 40 41 42 43 44 45 46 |
## 5、支付
[LetsGameAPI instance].appId = @"10022";
[LetsGameAPI instance].appKey = @"f899139df5e1059396431415e770c6dd";
NSMutableDictionary *payInfo = [NSMutableDictionary dictionary];
[payInfo setValue:@"5001" forKey:@"serverId"];//服务器id
[payInfo setValue:@"1000" forKey:@"channelId"];//渠道id
[payInfo setValue:@"10" forKey:@"amount"];//金额
[payInfo setValue:@"ios demo" forKey:@"extraInfo"];//外部订单信息
[payInfo setValue:@"元宝" forKey:@"product"];//物品信息
[[LetsGameAPI instance] pay:payInfo];
|