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