Commit f8353174d6ca5567dc5db58c116855eaa12a61a2
1 parent
5b5f573462
Exists in
master
and in
1 other branch
1、第三方支付中含有pay的字段修改 2、默认是v3版本的第三方支付
Showing 5 changed files with 3 additions and 5 deletions Inline Diff
ios/GameSDK.framework/Versions/A/GameSDK
No preview for this file type
ios/GameSDK.framework/Versions/A/Headers/LetsGameAPI.h
1 | 1 | ||
2 | #import <Foundation/Foundation.h> | 2 | #import <Foundation/Foundation.h> |
3 | #import "LSGAccount.h" | 3 | #import "LSGAccount.h" |
4 | #import "VKBridgeProtocol.h" | 4 | #import "VKBridgeProtocol.h" |
5 | 5 | ||
6 | 6 | ||
7 | typedef void (^LSGLoginSuccBlock)(NSString *userId, NSString *sessionKey, LSGAccountType type); | 7 | typedef void (^LSGLoginSuccBlock)(NSString *userId, NSString *sessionKey, LSGAccountType type); |
8 | typedef void (^LSGDismissBlock)(void); | 8 | typedef void (^LSGDismissBlock)(void); |
9 | 9 | ||
10 | static BOOL isDisableFB = NO; | 10 | static BOOL isDisableFB = NO; |
11 | 11 | ||
12 | static BOOL isEnableVK = NO; | 12 | static BOOL isEnableVK = NO; |
13 | 13 | ||
14 | static BOOL isDisableLine = NO; | 14 | static BOOL isDisableLine = NO; |
15 | 15 | ||
16 | static BOOL isDisableWeChat = NO; | 16 | static BOOL isDisableWeChat = NO; |
17 | 17 | ||
18 | static BOOL isDisableGoogle = NO; | 18 | static BOOL isDisableGoogle = NO; |
19 | 19 | ||
20 | static BOOL hiddenLogo = NO; | 20 | static BOOL hiddenLogo = NO; |
21 | 21 | ||
22 | //默认横屏 | 22 | //默认横屏 |
23 | static BOOL DeviceOrientationIsHorizontal = YES; | 23 | static BOOL DeviceOrientationIsHorizontal = YES; |
24 | 24 | ||
25 | static NSString *version = @"3.5.4"; | 25 | static NSString *version = @"3.5.5"; |
26 | 26 | ||
27 | @interface LetsGameAPI : NSObject<UIApplicationDelegate> | 27 | @interface LetsGameAPI : NSObject<UIApplicationDelegate> |
28 | 28 | ||
29 | @property (nonatomic, strong) NSString *appId; | 29 | @property (nonatomic, strong) NSString *appId; |
30 | @property (nonatomic, strong) NSString *appKey; | 30 | @property (nonatomic, strong) NSString *appKey; |
31 | @property(nonatomic, strong) NSString *channelId; | 31 | @property(nonatomic, strong) NSString *channelId; |
32 | @property (nonatomic, copy) LSGLoginSuccBlock succBlock; | 32 | @property (nonatomic, copy) LSGLoginSuccBlock succBlock; |
33 | @property (nonatomic, copy) LSGDismissBlock dismissBlock; | 33 | @property (nonatomic, copy) LSGDismissBlock dismissBlock; |
34 | @property (nonatomic, assign) int isDebug; | 34 | @property (nonatomic, assign) int isDebug; |
35 | @property (nonatomic, assign) int decideWebTo; | 35 | @property (nonatomic, assign) int decideWebTo; |
36 | @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; | 36 | @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; |
37 | //@property(nonatomic,strong) NSString *version; | 37 | //@property(nonatomic,strong) NSString *version; |
38 | 38 | ||
39 | + (instancetype)instance; | 39 | + (instancetype)instance; |
40 | 40 | ||
41 | -(NSString*)version; | 41 | -(NSString*)version; |
42 | 42 | ||
43 | - (void)showLoginView; | 43 | - (void)showLoginView; |
44 | - (void)showLoginViewInView:(UIView *)view; | 44 | - (void)showLoginViewInView:(UIView *)view; |
45 | 45 | ||
46 | +(void)disableFB:(BOOL)isDisable; | 46 | +(void)disableFB:(BOOL)isDisable; |
47 | +(void)disableGoogle:(BOOL)isDisable; | 47 | +(void)disableGoogle:(BOOL)isDisable; |
48 | +(void)disableWeChat:(BOOL)isDisable; | 48 | +(void)disableWeChat:(BOOL)isDisable; |
49 | +(void)disableLine:(BOOL)isDissable; | 49 | +(void)disableLine:(BOOL)isDissable; |
50 | +(BOOL)isFBDisable; | 50 | +(BOOL)isFBDisable; |
51 | +(BOOL)isVKEnable; | 51 | +(BOOL)isVKEnable; |
52 | +(BOOL)isWeChatDisable; | 52 | +(BOOL)isWeChatDisable; |
53 | +(BOOL)isGoogleDisable; | 53 | +(BOOL)isGoogleDisable; |
54 | +(BOOL)isLineDisable; | 54 | +(BOOL)isLineDisable; |
55 | +(void)hiddenLogo:(BOOL)isHidden; | 55 | +(void)hiddenLogo:(BOOL)isHidden; |
56 | +(BOOL)isHiddenLogo; | 56 | +(BOOL)isHiddenLogo; |
57 | +(void)DeviceOrientationIsHorizontal:(BOOL)isDisable; | 57 | +(void)DeviceOrientationIsHorizontal:(BOOL)isDisable; |
58 | +(BOOL)DeviceOrientationIsHorizontal; | 58 | +(BOOL)DeviceOrientationIsHorizontal; |
59 | 59 | ||
60 | - (void)logout; | 60 | - (void)logout; |
61 | 61 | ||
62 | - (void)hide; | 62 | - (void)hide; |
63 | //是否安装微信 | 63 | //是否安装微信 |
64 | -(BOOL)isWeChatInstall; | 64 | -(BOOL)isWeChatInstall; |
65 | //向微信注册应用 | 65 | //向微信注册应用 |
66 | -(void)registerAppWeChatWithAppId:(NSString *)appId | 66 | -(void)registerAppWeChatWithAppId:(NSString *)appId |
67 | appKey:(NSString *)appKey | 67 | appKey:(NSString *)appKey |
68 | Success:(void (^)())success | 68 | Success:(void (^)())success |
69 | failure:(void (^)())failure; | 69 | failure:(void (^)())failure; |
70 | 70 | ||
71 | - (BOOL)handleOpenURL:(NSURL *)url | 71 | - (BOOL)handleOpenURL:(NSURL *)url |
72 | sourceApplication:(NSString *)sourceApplication; | 72 | sourceApplication:(NSString *)sourceApplication; |
73 | 73 | ||
74 | -(void)pay:(NSDictionary*) payInfo handleCallBack:(void (^)()) payAccomplistCallback; | 74 | -(void)pWeb:(NSDictionary*) pWebInfo handleCallBack:(void (^)()) pWebAccomplistCallback; |
75 | |||
76 | //-(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback; | ||
77 | 75 | ||
78 | -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid succCallback:(void (^)(NSString* orderId)) succCallback failCallback:(void (^)(NSString* orderId)) failCallback; | 76 | -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid succCallback:(void (^)(NSString* orderId)) succCallback failCallback:(void (^)(NSString* orderId)) failCallback; |
79 | 77 | ||
80 | -(void)registeIapObserver; | 78 | -(void)registeIapObserver; |
81 | 79 | ||
82 | -(void)decideIsDebug:(int)isDebug; | 80 | -(void)decideIsDebug:(int)isDebug; |
83 | 81 | ||
84 | -(void)decideWebToVersion:(int)decideWebTo; | 82 | -(void)decideWebToVersion:(int)decideWebTo; |
85 | 83 | ||
86 | -(void)obtainAccessTokenSuccess:(void (^)(NSString *tokenString, NSString *refreshTime, NSString *expirationTime))success | 84 | -(void)obtainAccessTokenSuccess:(void (^)(NSString *tokenString, NSString *refreshTime, NSString *expirationTime))success |
87 | failure:(void (^)(NSString *errorString))failure; | 85 | failure:(void (^)(NSString *errorString))failure; |
88 | 86 | ||
89 | //获取是否展示安全页面,YES展示侵权页面,NO展示非侵权页面 | 87 | //获取是否展示安全页面,YES展示侵权页面,NO展示非侵权页面 |
90 | -(void)gameObtainSafeSetInfoWithAppId:(NSString *)appId | 88 | -(void)gameObtainSafeSetInfoWithAppId:(NSString *)appId |
91 | ChannelId:(NSString *)channelId | 89 | ChannelId:(NSString *)channelId |
92 | handleCallBack:(void (^)(BOOL resultStatus))callBack; | 90 | handleCallBack:(void (^)(BOOL resultStatus))callBack; |
93 | @end | 91 | @end |
94 | 92 |
ios/GameSDK.zip
No preview for this file type
ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ios/GameSDKDemo/letsgameDemo/LSGMainViewController.m
1 | // | 1 | // |
2 | // LSGMainViewController.m | 2 | // LSGMainViewController.m |
3 | // letsgameDemo | 3 | // letsgameDemo |
4 | // | 4 | // |
5 | // Created by zhy on 14-5-24. | 5 | // Created by zhy on 14-5-24. |
6 | // | 6 | // |
7 | // | 7 | // |
8 | 8 | ||
9 | #import "LSGMainViewController.h" | 9 | #import "LSGMainViewController.h" |
10 | #import "LetsGameAPI.h" | 10 | #import "LetsGameAPI.h" |
11 | #import "VKBridge.h" | 11 | #import "VKBridge.h" |
12 | 12 | ||
13 | 13 | ||
14 | @interface LSGMainViewController () | 14 | @interface LSGMainViewController () |
15 | 15 | ||
16 | @property (nonatomic, strong) UILabel *resultLabel; | 16 | @property (nonatomic, strong) UILabel *resultLabel; |
17 | 17 | ||
18 | @property(nonatomic,strong) UIButton *vkActivityShareBtn; | 18 | @property(nonatomic,strong) UIButton *vkActivityShareBtn; |
19 | 19 | ||
20 | @property(nonatomic,copy) NSString *sessionKey; | 20 | @property(nonatomic,copy) NSString *sessionKey; |
21 | @end | 21 | @end |
22 | 22 | ||
23 | @implementation LSGMainViewController | 23 | @implementation LSGMainViewController |
24 | 24 | ||
25 | - (void)loadView { | 25 | - (void)loadView { |
26 | [super loadView]; | 26 | [super loadView]; |
27 | NSLog(@"i come in"); | 27 | NSLog(@"i come in"); |
28 | self.view.backgroundColor = [UIColor whiteColor]; | 28 | self.view.backgroundColor = [UIColor whiteColor]; |
29 | // self.view.backgroundColor = [UIColor blackColor]; | 29 | // self.view.backgroundColor = [UIColor blackColor]; |
30 | 30 | ||
31 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 40, 100, 30)]; | 31 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 40, 100, 30)]; |
32 | btn.backgroundColor = [UIColor orangeColor]; | 32 | btn.backgroundColor = [UIColor orangeColor]; |
33 | [btn setTitle:@"测试入口" forState:UIControlStateNormal]; | 33 | [btn setTitle:@"测试入口" forState:UIControlStateNormal]; |
34 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 34 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
35 | btn.titleLabel.font = [UIFont systemFontOfSize:15]; | 35 | btn.titleLabel.font = [UIFont systemFontOfSize:15]; |
36 | [btn addTarget:self action:@selector(onClickTest) forControlEvents:UIControlEventTouchUpInside]; | 36 | [btn addTarget:self action:@selector(onClickTest) forControlEvents:UIControlEventTouchUpInside]; |
37 | [self.view addSubview:btn]; | 37 | [self.view addSubview:btn]; |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | UIButton *bindtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 100, 100, 30)]; | 41 | UIButton *bindtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 100, 100, 30)]; |
42 | bindtn.backgroundColor = [UIColor orangeColor]; | 42 | bindtn.backgroundColor = [UIColor orangeColor]; |
43 | [bindtn setTitle:@"退出账号" forState:UIControlStateNormal]; | 43 | [bindtn setTitle:@"退出账号" forState:UIControlStateNormal]; |
44 | [bindtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 44 | [bindtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
45 | bindtn.titleLabel.font = [UIFont systemFontOfSize:15]; | 45 | bindtn.titleLabel.font = [UIFont systemFontOfSize:15]; |
46 | [bindtn addTarget:self action:@selector(onLogoutTest) forControlEvents:UIControlEventTouchUpInside]; | 46 | [bindtn addTarget:self action:@selector(onLogoutTest) forControlEvents:UIControlEventTouchUpInside]; |
47 | [self.view addSubview:bindtn]; | 47 | [self.view addSubview:bindtn]; |
48 | 48 | ||
49 | UIButton *payBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 160, 100, 30)]; | 49 | UIButton *payBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 160, 100, 30)]; |
50 | payBtn.backgroundColor = [UIColor orangeColor]; | 50 | payBtn.backgroundColor = [UIColor orangeColor]; |
51 | [payBtn setTitle:@"支付" forState:UIControlStateNormal]; | 51 | [payBtn setTitle:@"支付" forState:UIControlStateNormal]; |
52 | [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 52 | [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
53 | payBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | 53 | payBtn.titleLabel.font = [UIFont systemFontOfSize:15]; |
54 | [payBtn addTarget:self action:@selector(onPayTest) forControlEvents:UIControlEventTouchUpInside]; | 54 | [payBtn addTarget:self action:@selector(onPayTest) forControlEvents:UIControlEventTouchUpInside]; |
55 | [self.view addSubview:payBtn]; | 55 | [self.view addSubview:payBtn]; |
56 | 56 | ||
57 | UIButton *iapBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 100, 30)]; | 57 | UIButton *iapBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 100, 30)]; |
58 | iapBtn.backgroundColor = [UIColor orangeColor]; | 58 | iapBtn.backgroundColor = [UIColor orangeColor]; |
59 | [iapBtn setTitle:@"IAP" forState:UIControlStateNormal]; | 59 | [iapBtn setTitle:@"IAP" forState:UIControlStateNormal]; |
60 | [iapBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 60 | [iapBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
61 | iapBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | 61 | iapBtn.titleLabel.font = [UIFont systemFontOfSize:15]; |
62 | [iapBtn addTarget:self action:@selector(onIapTest) forControlEvents:UIControlEventTouchUpInside]; | 62 | [iapBtn addTarget:self action:@selector(onIapTest) forControlEvents:UIControlEventTouchUpInside]; |
63 | [self.view addSubview:iapBtn]; | 63 | [self.view addSubview:iapBtn]; |
64 | 64 | ||
65 | } | 65 | } |
66 | 66 | ||
67 | - (UILabel *)resultLabel { | 67 | - (UILabel *)resultLabel { |
68 | if (!_resultLabel) { | 68 | if (!_resultLabel) { |
69 | _resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.view.frame) - 90, self.view.frame.size.width, 60)]; | 69 | _resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.view.frame) - 90, self.view.frame.size.width, 60)]; |
70 | _resultLabel.backgroundColor = [UIColor clearColor]; | 70 | _resultLabel.backgroundColor = [UIColor clearColor]; |
71 | _resultLabel.textAlignment = NSTextAlignmentCenter; | 71 | _resultLabel.textAlignment = NSTextAlignmentCenter; |
72 | _resultLabel.textColor = [UIColor redColor]; | 72 | _resultLabel.textColor = [UIColor redColor]; |
73 | _resultLabel.font = [UIFont systemFontOfSize:15]; | 73 | _resultLabel.font = [UIFont systemFontOfSize:15]; |
74 | _resultLabel.numberOfLines = 4; | 74 | _resultLabel.numberOfLines = 4; |
75 | _resultLabel.lineBreakMode = NSLineBreakByWordWrapping; | 75 | _resultLabel.lineBreakMode = NSLineBreakByWordWrapping; |
76 | [self.view addSubview:_resultLabel]; | 76 | [self.view addSubview:_resultLabel]; |
77 | } | 77 | } |
78 | 78 | ||
79 | return _resultLabel; | 79 | return _resultLabel; |
80 | } | 80 | } |
81 | 81 | ||
82 | 82 | ||
83 | - (void)onClickTest { | 83 | - (void)onClickTest { |
84 | 84 | ||
85 | [LetsGameAPI instance].appId = @"100";//10047 | 85 | [LetsGameAPI instance].appId = @"100";//10047 |
86 | [LetsGameAPI instance].appKey = @"f899139df5e1059396431415e770c6dd";//eccd9f7dc92858b741132fda313130cf | 86 | [LetsGameAPI instance].appKey = @"f899139df5e1059396431415e770c6dd";//eccd9f7dc92858b741132fda313130cf |
87 | [LetsGameAPI instance].channelId = @"10010"; | 87 | [LetsGameAPI instance].channelId = @"10010"; |
88 | [LetsGameAPI hiddenLogo:YES]; | 88 | [LetsGameAPI hiddenLogo:YES]; |
89 | // [LetsGameAPI disableFB:YES]; | 89 | // [LetsGameAPI disableFB:YES]; |
90 | // [LetsGameAPI disableGoogle:YES]; | 90 | // [LetsGameAPI disableGoogle:YES]; |
91 | // [LetsGameAPI disableLine:YES]; | 91 | // [LetsGameAPI disableLine:YES]; |
92 | // [LetsGameAPI disableWeChat:YES]; | 92 | // [LetsGameAPI disableWeChat:YES]; |
93 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); | 93 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); |
94 | //启用vk登录 | 94 | //启用vk登录 |
95 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; | 95 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; |
96 | [LetsGameAPI instance].vkBridge = vkBridge; | 96 | [LetsGameAPI instance].vkBridge = vkBridge; |
97 | 97 | ||
98 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { | 98 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { |
99 | self.sessionKey = sessionKey; | 99 | self.sessionKey = sessionKey; |
100 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; | 100 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; |
101 | }; | 101 | }; |
102 | [LetsGameAPI instance].dismissBlock = ^() { | 102 | [LetsGameAPI instance].dismissBlock = ^() { |
103 | self.resultLabel.text = @"dismiss without login"; | 103 | self.resultLabel.text = @"dismiss without login"; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | [[LetsGameAPI instance] showLoginView]; | 106 | [[LetsGameAPI instance] showLoginView]; |
107 | } | 107 | } |
108 | 108 | ||
109 | 109 | ||
110 | - (void)onLogoutTest { | 110 | - (void)onLogoutTest { |
111 | [LetsGameAPI instance].appId = @"10056"; | 111 | [LetsGameAPI instance].appId = @"10056"; |
112 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 112 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
113 | [[LetsGameAPI instance] logout]; | 113 | [[LetsGameAPI instance] logout]; |
114 | 114 | ||
115 | } | 115 | } |
116 | 116 | ||
117 | -(void)onPayTest{ | 117 | -(void)onPayTest{ |
118 | [LetsGameAPI instance].appId = @"10022";//@"10056";//10022 | 118 | [LetsGameAPI instance].appId = @"10022";//@"10056";//10022 |
119 | [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab";//@"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab | 119 | [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab";//@"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab |
120 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 120 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
121 | [payInfo setValue:@"100" forKey:@"serverId"]; | 121 | [payInfo setValue:@"100" forKey:@"serverId"]; |
122 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 122 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
123 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 123 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
124 | [payInfo setValue:@"10" forKey:@"amount"]; | 124 | [payInfo setValue:@"10" forKey:@"amount"]; |
125 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 125 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
126 | [payInfo setValue:@"test" forKey:@"product"]; | 126 | [payInfo setValue:@"test" forKey:@"product"]; |
127 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey | 127 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey |
128 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ | 128 | [[LetsGameAPI instance] pWeb:payInfo handleCallBack:^{ |
129 | NSLog(@"第三方支付完成"); | 129 | NSLog(@"第三方支付完成"); |
130 | }]; | 130 | }]; |
131 | } | 131 | } |
132 | 132 | ||
133 | -(void)onIapTest{ | 133 | -(void)onIapTest{ |
134 | [LetsGameAPI instance].appId = @"10056"; | 134 | [LetsGameAPI instance].appId = @"10056"; |
135 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 135 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
136 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 136 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
137 | [payInfo setValue:@"5001" forKey:@"serverId"]; | 137 | [payInfo setValue:@"5001" forKey:@"serverId"]; |
138 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 138 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
139 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 139 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
140 | [payInfo setValue:@"10" forKey:@"amount"]; | 140 | [payInfo setValue:@"10" forKey:@"amount"]; |
141 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 141 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
142 | [payInfo setValue:@"test.product.1" forKey:@"product"]; | 142 | [payInfo setValue:@"test.product.1" forKey:@"product"]; |
143 | [[LetsGameAPI instance] iap:payInfo forUser:@"" succCallback:^(NSString *orderId) { | 143 | [[LetsGameAPI instance] iap:payInfo forUser:@"" succCallback:^(NSString *orderId) { |
144 | //注意测试仅仅是通知客户端成功,但是还需要向服务器请求验证是否成功,以服务端验证为准 | 144 | //注意测试仅仅是通知客户端成功,但是还需要向服务器请求验证是否成功,以服务端验证为准 |
145 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); | 145 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); |
146 | } failCallback:^(NSString *orderId) { | 146 | } failCallback:^(NSString *orderId) { |
147 | NSLog(@"IAP file orderId of Gumptech:%@",orderId); | 147 | NSLog(@"IAP file orderId of Gumptech:%@",orderId); |
148 | }]; | 148 | }]; |
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | - (BOOL)shouldAutorotate { | 152 | - (BOOL)shouldAutorotate { |
153 | return YES; | 153 | return YES; |
154 | } | 154 | } |
155 | 155 | ||
156 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ | 156 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ |
157 | return UIInterfaceOrientationMaskAll; | 157 | return UIInterfaceOrientationMaskAll; |
158 | } | 158 | } |
159 | 159 | ||
160 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | 160 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
161 | return YES; | 161 | return YES; |
162 | } | 162 | } |
163 | 163 | ||
164 | @end | 164 | @end |
165 | 165 |