Commit 75dfe8dfa4c50a72907dffd0dc5b3fcb876144c1
1 parent
b38bedde
退出百度登录
Showing
6 changed files
with
23 additions
and
1 deletions
CNLiveBBASMModule.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveBBASMModule' | 10 | s.name = 'CNLiveBBASMModule' |
| 11 | - s.version = '0.0.9' | 11 | + s.version = '0.0.10' |
| 12 | s.summary = 'CNLive-iOS百度小程序接入' | 12 | s.summary = 'CNLive-iOS百度小程序接入' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLiveBBASMModule/Classes/CNLiveBBASMImpl/CNManager/CNBBASMJumpService.h
| @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 15 | - (void)registerBBASMManager:(NSDictionary *)launchOptions; | 15 | - (void)registerBBASMManager:(NSDictionary *)launchOptions; |
| 16 | - (void)openBBASMModule:(NSString *)urlStr; | 16 | - (void)openBBASMModule:(NSString *)urlStr; |
| 17 | - (BOOL)cashierHandleOpenUrl:(NSURL *)url; | 17 | - (BOOL)cashierHandleOpenUrl:(NSURL *)url; |
| 18 | +- (void)accountLogout; | ||
| 18 | 19 | ||
| 19 | @end | 20 | @end |
| 20 | @interface CNBBASMJumpService : NSObject<CNBBASMJumpProtocol> | 21 | @interface CNBBASMJumpService : NSObject<CNBBASMJumpProtocol> |
CNLiveBBASMModule/Classes/CNLiveBBASMImpl/CNManager/CNBBASMJumpService.m
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | #import "CNBBASMJumpService.h" | 8 | #import "CNBBASMJumpService.h" |
| 9 | #import <CNLiveEnvironment/CNLiveEnvironment.h> | 9 | #import <CNLiveEnvironment/CNLiveEnvironment.h> |
| 10 | #import <BBAMNP/BBASMManager.h> | 10 | #import <BBAMNP/BBASMManager.h> |
| 11 | +#import <BBAMNP/BBAMNP.h> | ||
| 11 | #import <BainuoCashierSDK/BDNCashierSDK.h> | 12 | #import <BainuoCashierSDK/BDNCashierSDK.h> |
| 12 | #import <CNLiveBeeHive/BHRouter.h> | 13 | #import <CNLiveBeeHive/BHRouter.h> |
| 13 | 14 | ||
| @@ -45,6 +46,10 @@ static NSString *const CNLiveBBASMGetPluginDesC = @"getPluginDescriptionPath"; | @@ -45,6 +46,10 @@ static NSString *const CNLiveBBASMGetPluginDesC = @"getPluginDescriptionPath"; | ||
| 45 | return result; | 46 | return result; |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 49 | +- (void)accountLogout | ||
| 50 | +{ | ||
| 51 | + [Pyramid.bba_MNP unionAccountLogOut]; | ||
| 52 | +} | ||
| 48 | + (void)shareBBASMWithParams:(NSDictionary *)params | 53 | + (void)shareBBASMWithParams:(NSDictionary *)params |
| 49 | { | 54 | { |
| 50 | NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",CNLiveBBASMRouterWithMainkey,CNLiveBBASMShareMethod]]; | 55 | NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",CNLiveBBASMRouterWithMainkey,CNLiveBBASMShareMethod]]; |
Example/CNLiveBBASMModule/CNLIVEViewController.m
| @@ -27,14 +27,24 @@ | @@ -27,14 +27,24 @@ | ||
| 27 | self.view.backgroundColor = [UIColor whiteColor]; | 27 | self.view.backgroundColor = [UIColor whiteColor]; |
| 28 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 40+100, 100, 44)]; | 28 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 40+100, 100, 44)]; |
| 29 | [btn addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside]; | 29 | [btn addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside]; |
| 30 | + [btn setTitle:@"百度小程序" forState:UIControlStateNormal]; | ||
| 30 | btn.backgroundColor = [UIColor grayColor]; | 31 | btn.backgroundColor = [UIColor grayColor]; |
| 31 | [self.view addSubview:btn]; | 32 | [self.view addSubview:btn]; |
| 33 | + UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(150, 40+100, 100, 44)]; | ||
| 34 | + [btn1 addTarget:self action:@selector(logOut) forControlEvents:UIControlEventTouchUpInside]; | ||
| 35 | + [btn1 setTitle:@"退出百度登录" forState:UIControlStateNormal]; | ||
| 36 | + btn1.backgroundColor = [UIColor grayColor]; | ||
| 37 | + [self.view addSubview:btn1]; | ||
| 32 | } | 38 | } |
| 33 | -(void)action{ | 39 | -(void)action{ |
| 34 | 40 | ||
| 35 | NSString *spURL = @"cnlive://swan/4fecoAqgCIUtzIyA4FAPgoyrc4oUc25c"; | 41 | NSString *spURL = @"cnlive://swan/4fecoAqgCIUtzIyA4FAPgoyrc4oUc25c"; |
| 36 | [CNLiveBBASMModuleService openBBASMModule:spURL]; | 42 | [CNLiveBBASMModuleService openBBASMModule:spURL]; |
| 37 | } | 43 | } |
| 44 | +- (void)logOut | ||
| 45 | +{ | ||
| 46 | + [CNLiveBBASMModuleService accountLogout]; | ||
| 47 | +} | ||
| 38 | - (void)didReceiveMemoryWarning | 48 | - (void)didReceiveMemoryWarning |
| 39 | { | 49 | { |
| 40 | [super didReceiveMemoryWarning]; | 50 | [super didReceiveMemoryWarning]; |
Example/CNLiveBBASMModule/CNLiveBBASMModule/CNLiveBBASMModuleService.h
| @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 23 | + (void)registerBBASMManager:(NSDictionary *)launchOptions; | 23 | + (void)registerBBASMManager:(NSDictionary *)launchOptions; |
| 24 | + (void)openBBASMModule:(NSString *)urlStr; | 24 | + (void)openBBASMModule:(NSString *)urlStr; |
| 25 | + (BOOL)cashierHandleOpenUrl:(NSURL *)url; | 25 | + (BOOL)cashierHandleOpenUrl:(NSURL *)url; |
| 26 | ++ (void)accountLogout; | ||
| 26 | @end | 27 | @end |
| 27 | 28 | ||
| 28 | NS_ASSUME_NONNULL_END | 29 | NS_ASSUME_NONNULL_END |
Example/CNLiveBBASMModule/CNLiveBBASMModule/CNLiveBBASMModuleService.m
| @@ -17,6 +17,7 @@ static NSString *const CNLiveBBASMWithMainRouter = @"com.cnlive.CNLiveNetAdd://c | @@ -17,6 +17,7 @@ static NSString *const CNLiveBBASMWithMainRouter = @"com.cnlive.CNLiveNetAdd://c | ||
| 17 | static NSString *const CNLiveRegisterBBASMManager = @"registerBBASMManager:"; | 17 | static NSString *const CNLiveRegisterBBASMManager = @"registerBBASMManager:"; |
| 18 | static NSString *const CNLiveOpenBBASMModule = @"openBBASMModule:"; | 18 | static NSString *const CNLiveOpenBBASMModule = @"openBBASMModule:"; |
| 19 | static NSString *const CNLiveCashierHandleOpenUrl = @"cashierHandleOpenUrl:"; | 19 | static NSString *const CNLiveCashierHandleOpenUrl = @"cashierHandleOpenUrl:"; |
| 20 | +static NSString *const CNLiveAccountLogOut = @"accountLogout"; | ||
| 20 | @BeeHiveService(CNliveBBASMModuleProtocol, CNLiveBBASMModuleService) | 21 | @BeeHiveService(CNliveBBASMModuleProtocol, CNLiveBBASMModuleService) |
| 21 | @implementation CNLiveBBASMModuleService | 22 | @implementation CNLiveBBASMModuleService |
| 22 | - (void)shareBBASMWithParams:(NSDictionary *)params{ | 23 | - (void)shareBBASMWithParams:(NSDictionary *)params{ |
| @@ -67,4 +68,8 @@ static NSString *const CNLiveCashierHandleOpenUrl = @"cashierHandleOpenUrl:"; | @@ -67,4 +68,8 @@ static NSString *const CNLiveCashierHandleOpenUrl = @"cashierHandleOpenUrl:"; | ||
| 67 | }]; | 68 | }]; |
| 68 | return result; | 69 | return result; |
| 69 | } | 70 | } |
| 71 | ++ (void)accountLogout{ | ||
| 72 | + NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",CNLiveBBASMWithMainRouter,CNLiveAccountLogOut]]; | ||
| 73 | + [BHRouter openURL:url]; | ||
| 74 | +} | ||
| 70 | @end | 75 | @end |