Skip to content

Commit

Permalink
文案调整, 提示用户调整
Browse files Browse the repository at this point in the history
  • Loading branch information
tds-developer committed Dec 25, 2020
1 parent 02ea5ff commit fcf2886
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions TdsDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@
#import <TapSDK/TDSMoment.h>

@interface ViewController ()<TapLoginResultDelegate, TDSMomentDelegate>

- (void) initTapSDK;

@end


@implementation ViewController


- (void)viewDidLoad {
[super viewDidLoad];

UIButton *loginButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 50)];
loginButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[loginButton setTitle:@"Login" forState:UIControlStateNormal];
[loginButton setTitle:@"登录" forState:UIControlStateNormal];
[loginButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
[loginButton addTarget:self action:@selector(taptapLogin:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:loginButton];


UIButton *logoutButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 100, 50)];
logoutButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[logoutButton setTitle:@"Logout" forState:UIControlStateNormal];
[logoutButton setTitle:@"登出" forState:UIControlStateNormal];
[logoutButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
[logoutButton addTarget:self action:@selector(taptapLogout:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:logoutButton];
Expand All @@ -41,21 +43,19 @@ - (void)viewDidLoad {

UIButton *momentButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 300, 100, 50)];
momentButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[momentButton setTitle:@"Moment" forState:UIControlStateNormal];
[momentButton setTitle:@"打开动态" forState:UIControlStateNormal];
[momentButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
[momentButton addTarget:self action:@selector(taptapMoment:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:momentButton];


UIButton *momentRedPoint = [[UIButton alloc] initWithFrame:CGRectMake(100, 400, 300, 50)];
momentRedPoint.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[momentRedPoint setTitle:@"动态小红点请求" forState:UIControlStateNormal];
[momentRedPoint setTitle:@"获取动态未读数" forState:UIControlStateNormal];
[momentRedPoint setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
[momentRedPoint addTarget:self action:@selector(taptapMomentRedPoint:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:momentRedPoint];



[self initTapSDK];
}

Expand All @@ -79,7 +79,6 @@ - (void) initTapSDK {
// 开启 动态
[TDSInitializer enableMoment];
[TDSMomentSdk setDelegate:self];

}


Expand All @@ -90,6 +89,7 @@ - (void) initTapSDK {
登录
*/
- (void) taptapLogin:(UIButton *) button {

[TapLoginHelper startTapLogin:@[@"public_profile"]];
}

Expand All @@ -115,6 +115,11 @@ - (void)onLoginCancel {
}

- (void)onLoginError:(AccountGlobalError *)error{
if (error != nil ) {
if ([LOGIN_ERROR_ACCESS_DENIED isEqualToString:error.error] || [LOGIN_ERROR_FORBIDDEN isEqual:error.error]) {
NSLog(@"当前 TOKEN已经失效, 需要提示用户重新执行 TapTap 登录流程");
}
}
NSLog(@"Login error %@", [error toJsonString]);
}

Expand Down

0 comments on commit fcf2886

Please sign in to comment.