Commit 3d40d58ddc76f21d2a40282c49599a347b36fc67

Authored by 赵康
1 parent bd0fbf81f0
Exists in master

修改Facebook登录无回调问题,重新打包更新版本

Showing 5 changed files with 4 additions and 3 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 8
9 typedef void (^LSGDismissBlock)(void); 9 typedef void (^LSGDismissBlock)(void);
10 10
11 static BOOL isDisableFB = NO; 11 static BOOL isDisableFB = NO;
12 12
13 static BOOL isEnableVK = NO; 13 static BOOL isEnableVK = NO;
14 14
15 static NSString *version = @"3.3.3"; 15 static NSString *version = @"3.3.4";
16 16
17 @interface LetsGameAPI : NSObject 17 @interface LetsGameAPI : NSObject
18 18
19 @property (nonatomic, strong) NSString *appId; 19 @property (nonatomic, strong) NSString *appId;
20 @property (nonatomic, strong) NSString *appKey; 20 @property (nonatomic, strong) NSString *appKey;
21 @property (nonatomic, copy) LSGLoginSuccBlock succBlock; 21 @property (nonatomic, copy) LSGLoginSuccBlock succBlock;
22 @property (nonatomic, copy) LSGDismissBlock dismissBlock; 22 @property (nonatomic, copy) LSGDismissBlock dismissBlock;
23 23
24 @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; 24 @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge;
25 //@property(nonatomic,strong) NSString *version; 25 //@property(nonatomic,strong) NSString *version;
26 26
27 + (instancetype)instance; 27 + (instancetype)instance;
28 28
29 -(NSString*)version; 29 -(NSString*)version;
30 30
31 - (void)showLoginView; 31 - (void)showLoginView;
32 - (void)showLoginViewInView:(UIView *)view; 32 - (void)showLoginViewInView:(UIView *)view;
33 33
34 +(void)disableFB:(BOOL)isDisable; 34 +(void)disableFB:(BOOL)isDisable;
35 +(BOOL)isFBDisable; 35 +(BOOL)isFBDisable;
36 +(BOOL)isVKEnable; 36 +(BOOL)isVKEnable;
37 37
38 - (void)logout; 38 - (void)logout;
39 39
40 - (void)hide; 40 - (void)hide;
41 41
42 - (BOOL)handleOpenURL:(NSURL *)url 42 - (BOOL)handleOpenURL:(NSURL *)url
43 sourceApplication:(NSString *)sourceApplication; 43 sourceApplication:(NSString *)sourceApplication;
44 44
45 -(void)pay:(NSDictionary*) payInfo; 45 -(void)pay:(NSDictionary*) payInfo;
46 46
47 -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback; 47 -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback;
48 48
49 -(void)registeIapObserver; 49 -(void)registeIapObserver;
50 50
51 @end 51 @end
52 52
No preview for this file type
ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/gump.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 @end 19 @end
20 20
21 @implementation LSGMainViewController 21 @implementation LSGMainViewController
22 22
23 - (void)loadView { 23 - (void)loadView {
24 [super loadView]; 24 [super loadView];
25 25
26 self.view.backgroundColor = [UIColor whiteColor]; 26 self.view.backgroundColor = [UIColor whiteColor];
27 27
28 UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 40, 100, 30)]; 28 UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 40, 100, 30)];
29 btn.backgroundColor = [UIColor orangeColor]; 29 btn.backgroundColor = [UIColor orangeColor];
30 [btn setTitle:@"测试入口" forState:UIControlStateNormal]; 30 [btn setTitle:@"测试入口" forState:UIControlStateNormal];
31 [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 31 [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
32 btn.titleLabel.font = [UIFont systemFontOfSize:15]; 32 btn.titleLabel.font = [UIFont systemFontOfSize:15];
33 [btn addTarget:self action:@selector(onClickTest) forControlEvents:UIControlEventTouchUpInside]; 33 [btn addTarget:self action:@selector(onClickTest) forControlEvents:UIControlEventTouchUpInside];
34 [self.view addSubview:btn]; 34 [self.view addSubview:btn];
35 35
36 36
37 37
38 UIButton *bindtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 100, 100, 30)]; 38 UIButton *bindtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 100, 100, 30)];
39 bindtn.backgroundColor = [UIColor orangeColor]; 39 bindtn.backgroundColor = [UIColor orangeColor];
40 [bindtn setTitle:@"退出账号" forState:UIControlStateNormal]; 40 [bindtn setTitle:@"退出账号" forState:UIControlStateNormal];
41 [bindtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 41 [bindtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
42 bindtn.titleLabel.font = [UIFont systemFontOfSize:15]; 42 bindtn.titleLabel.font = [UIFont systemFontOfSize:15];
43 [bindtn addTarget:self action:@selector(onLogoutTest) forControlEvents:UIControlEventTouchUpInside]; 43 [bindtn addTarget:self action:@selector(onLogoutTest) forControlEvents:UIControlEventTouchUpInside];
44 [self.view addSubview:bindtn]; 44 [self.view addSubview:bindtn];
45 45
46 UIButton *payBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 160, 100, 30)]; 46 UIButton *payBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 160, 100, 30)];
47 payBtn.backgroundColor = [UIColor orangeColor]; 47 payBtn.backgroundColor = [UIColor orangeColor];
48 [payBtn setTitle:@"支付" forState:UIControlStateNormal]; 48 [payBtn setTitle:@"支付" forState:UIControlStateNormal];
49 [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 49 [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
50 payBtn.titleLabel.font = [UIFont systemFontOfSize:15]; 50 payBtn.titleLabel.font = [UIFont systemFontOfSize:15];
51 [payBtn addTarget:self action:@selector(onPayTest) forControlEvents:UIControlEventTouchUpInside]; 51 [payBtn addTarget:self action:@selector(onPayTest) forControlEvents:UIControlEventTouchUpInside];
52 [self.view addSubview:payBtn]; 52 [self.view addSubview:payBtn];
53 53
54 UIButton *iapBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 100, 30)]; 54 UIButton *iapBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 100, 30)];
55 iapBtn.backgroundColor = [UIColor orangeColor]; 55 iapBtn.backgroundColor = [UIColor orangeColor];
56 [iapBtn setTitle:@"IAP" forState:UIControlStateNormal]; 56 [iapBtn setTitle:@"IAP" forState:UIControlStateNormal];
57 [iapBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 57 [iapBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
58 iapBtn.titleLabel.font = [UIFont systemFontOfSize:15]; 58 iapBtn.titleLabel.font = [UIFont systemFontOfSize:15];
59 [iapBtn addTarget:self action:@selector(onIapTest) forControlEvents:UIControlEventTouchUpInside]; 59 [iapBtn addTarget:self action:@selector(onIapTest) forControlEvents:UIControlEventTouchUpInside];
60 [self.view addSubview:iapBtn]; 60 [self.view addSubview:iapBtn];
61 61
62 62
63 } 63 }
64 64
65 - (UILabel *)resultLabel { 65 - (UILabel *)resultLabel {
66 if (!_resultLabel) { 66 if (!_resultLabel) {
67 _resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.view.frame) - 90, self.view.frame.size.width, 60)]; 67 _resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.view.frame) - 90, self.view.frame.size.width, 60)];
68 _resultLabel.backgroundColor = [UIColor clearColor]; 68 _resultLabel.backgroundColor = [UIColor clearColor];
69 _resultLabel.textAlignment = NSTextAlignmentCenter; 69 _resultLabel.textAlignment = NSTextAlignmentCenter;
70 _resultLabel.textColor = [UIColor redColor]; 70 _resultLabel.textColor = [UIColor redColor];
71 _resultLabel.font = [UIFont systemFontOfSize:15]; 71 _resultLabel.font = [UIFont systemFontOfSize:15];
72 _resultLabel.numberOfLines = 4; 72 _resultLabel.numberOfLines = 4;
73 _resultLabel.lineBreakMode = NSLineBreakByWordWrapping; 73 _resultLabel.lineBreakMode = NSLineBreakByWordWrapping;
74 [self.view addSubview:_resultLabel]; 74 [self.view addSubview:_resultLabel];
75 } 75 }
76 76
77 return _resultLabel; 77 return _resultLabel;
78 } 78 }
79 79
80 80
81 - (void)onClickTest { 81 - (void)onClickTest {
82 [LetsGameAPI instance].appId = @"10022"; 82 NSLog(@"mainBundle:%@",[[LetsGameAPI instance] version]);
83 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab"; 83 [LetsGameAPI instance].appId = @"10047";
84 [LetsGameAPI instance].appKey = @"eccd9f7dc92858b741132fda313130cf";
84 // [LetsGameAPI disableFB:NO]; 85 // [LetsGameAPI disableFB:NO];
85 NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); 86 NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]);
86 //启用vk登录 87 //启用vk登录
87 // VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; 88 // VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"];
88 // [LetsGameAPI instance].vkBridge = vkBridge; 89 // [LetsGameAPI instance].vkBridge = vkBridge;
89 90
90 [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { 91 [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) {
91 self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; 92 self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type];
92 }; 93 };
93 [LetsGameAPI instance].dismissBlock = ^() { 94 [LetsGameAPI instance].dismissBlock = ^() {
94 self.resultLabel.text = @"dismiss without login"; 95 self.resultLabel.text = @"dismiss without login";
95 }; 96 };
96 97
97 [[LetsGameAPI instance] showLoginView]; 98 [[LetsGameAPI instance] showLoginView];
98 } 99 }
99 100
100 101
101 - (void)onLogoutTest { 102 - (void)onLogoutTest {
102 [LetsGameAPI instance].appId = @"10000"; 103 [LetsGameAPI instance].appId = @"10000";
103 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab"; 104 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab";
104 [[LetsGameAPI instance] logout]; 105 [[LetsGameAPI instance] logout];
105 106
106 } 107 }
107 108
108 -(void)onPayTest{ 109 -(void)onPayTest{
109 [LetsGameAPI instance].appId = @"10022"; 110 [LetsGameAPI instance].appId = @"10022";
110 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab"; 111 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab";
111 NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; 112 NSMutableDictionary *payInfo = [NSMutableDictionary dictionary];
112 [payInfo setValue:@"5001" forKey:@"serverId"]; 113 [payInfo setValue:@"5001" forKey:@"serverId"];
113 [payInfo setValue:@"10010" forKey:@"roleId"]; 114 [payInfo setValue:@"10010" forKey:@"roleId"];
114 [payInfo setValue:@"1000" forKey:@"channelId"]; 115 [payInfo setValue:@"1000" forKey:@"channelId"];
115 [payInfo setValue:@"10" forKey:@"amount"]; 116 [payInfo setValue:@"10" forKey:@"amount"];
116 [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; 117 [payInfo setValue:@"ios demo" forKey:@"extraInfo"];
117 [payInfo setValue:@"元宝" forKey:@"product"]; 118 [payInfo setValue:@"元宝" forKey:@"product"];
118 [[LetsGameAPI instance] pay:payInfo]; 119 [[LetsGameAPI instance] pay:payInfo];
119 } 120 }
120 121
121 -(void)onIapTest{ 122 -(void)onIapTest{
122 [LetsGameAPI instance].appId = @"10022"; 123 [LetsGameAPI instance].appId = @"10022";
123 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab"; 124 [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab";
124 NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; 125 NSMutableDictionary *payInfo = [NSMutableDictionary dictionary];
125 [payInfo setValue:@"5001" forKey:@"serverId"]; 126 [payInfo setValue:@"5001" forKey:@"serverId"];
126 [payInfo setValue:@"10010" forKey:@"roleId"]; 127 [payInfo setValue:@"10010" forKey:@"roleId"];
127 [payInfo setValue:@"1000" forKey:@"channelId"]; 128 [payInfo setValue:@"1000" forKey:@"channelId"];
128 [payInfo setValue:@"10" forKey:@"amount"]; 129 [payInfo setValue:@"10" forKey:@"amount"];
129 [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; 130 [payInfo setValue:@"ios demo" forKey:@"extraInfo"];
130 [payInfo setValue:@"test.product.1" forKey:@"product"]; 131 [payInfo setValue:@"test.product.1" forKey:@"product"];
131 [[LetsGameAPI instance] iap:payInfo forUser:@"" handleCallback:^(NSString* orderId){ 132 [[LetsGameAPI instance] iap:payInfo forUser:@"" handleCallback:^(NSString* orderId){
132 NSLog(@"IAP completed orderId of Gumptech:%@",orderId); 133 NSLog(@"IAP completed orderId of Gumptech:%@",orderId);
133 }]; 134 }];
134 } 135 }
135 136
136 137
137 - (BOOL)shouldAutorotate { 138 - (BOOL)shouldAutorotate {
138 return YES; 139 return YES;
139 } 140 }
140 141
141 -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ 142 -(UIInterfaceOrientationMask)supportedInterfaceOrientations{
142 return UIInterfaceOrientationMaskAll; 143 return UIInterfaceOrientationMaskAll;
143 } 144 }
144 145
145 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 146 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
146 return YES; 147 return YES;
147 } 148 }
148 149
149 @end 150 @end
150 151