Commit 79f6c46effadd74f71a62279966507f72b676660
1 parent
bf74f0bb66
Exists in
master
文档修改,注销部分和token获取
Showing 3 changed files with 23 additions and 4 deletions Side-by-side Diff
IOSDocument.md
... | ... | @@ -82,8 +82,15 @@ Xcode 4: Open your Info.plist then add a new row URL Types. Set the URL identifi |
82 | 82 | NSLog(@"dismiss without login"); |
83 | 83 | }; |
84 | 84 | |
85 | +### 5、登录注销 | |
86 | +注销接口只要设置过appId和appKey之后就不需要设置了,注销完成之后会回到登录界面。FB登录回到登录页面,Gump登录或者游客登录回到登录框。 | |
85 | 87 | |
86 | -### 5、第三方支付 | |
88 | + [LetsGameAPI instance].appId = @"100";//设置appId | |
89 | + [LetsGameAPI instance].appKey = @"100";//设置appkey | |
90 | + [[LetsGameAPI instance] logout]; //注销 | |
91 | + | |
92 | + | |
93 | +### 6、第三方支付 | |
87 | 94 | [LetsGameAPI instance].appId = @"10022"; |
88 | 95 | [LetsGameAPI instance].appKey = @"f899139df5e1059396431415e770c6dd"; |
89 | 96 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
... | ... | @@ -100,7 +107,7 @@ Xcode 4: Open your Info.plist then add a new row URL Types. Set the URL identifi |
100 | 107 | NSLog(@"第三方支付完成"); |
101 | 108 | }]]; |
102 | 109 | |
103 | -### 6、IAP支付 | |
110 | +### 7、IAP支付 | |
104 | 111 | 若要使用apple IAP支付,需要在AppDelegate的application: didFinishLaunchingWithOptions:方法内注册iap observer,使用如下方法 |
105 | 112 | |
106 | 113 | [[LetsGameAPI instance] registeIapObserver]; |
... | ... | @@ -120,8 +127,20 @@ Xcode 4: Open your Info.plist then add a new row URL Types. Set the URL identifi |
120 | 127 | //orderId为gump生成的订单号,此订单号可以在gump server查询此笔支付是否成功 |
121 | 128 | NSLog(@"iap completed orderId of gumptech:%@",orderId); |
122 | 129 | }]; |
123 | -### 7、SDK版本测试设置 | |
130 | +### 8、SDK版本测试设置 | |
124 | 131 | 若想使用SDK的debug版本,需要在AppDelegate的application: didFinishLaunchingWithOptions:中设置: |
125 | 132 | |
126 | 133 | [[LetsGameAPI instance] decideIsDebug:1]; |
127 | 134 | 不设置或者设置为0时,默认使用release版本 |
135 | +### 9、token的获取 | |
136 | +FB登录之后会产生token并自动登录,需要如果需要token的话,需要自己调用接口获取。 | |
137 | + | |
138 | + //tokenString:token字符串 | |
139 | + //refreshTime:refreshTime token最后刷新的时间,即获取的token的时间 | |
140 | + //expirationTime:expirationTime token最后的有效时间 | |
141 | + [[LetsGameAPI instance] obtainAccessTokenSuccess:^(NSString *tokenString, NSString *refreshTime, NSString *expirationTime) { | |
142 | + NSLog(@"tokenString %@, refreshTime %@, expirationTime %@", tokenString, refreshTime, expirationTime); | |
143 | + } failure:^(NSString *errorString) { | |
144 | + NSLog(@"get token faile"); | |
145 | + }]; | |
146 | + |
ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ios/GameSDKDemo/letsgameDemo/LSGMainViewController.m