Skip to content

Commit f30d5a5

Browse files
committed
手机未安装微信时,隐藏微信登录的按钮 - 微信貌似取消了用手机号码授权登录的方式了
1 parent b64c978 commit f30d5a5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Coding_iOS/Coding_iOS-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</dict>
3838
</array>
3939
<key>CFBundleVersion</key>
40-
<string>5.0.201802091630</string>
40+
<string>5.0.201802130930</string>
4141
<key>ITSAppUsesNonExemptEncryption</key>
4242
<false/>
4343
<key>LSApplicationQueriesSchemes</key>

Coding_iOS/Controllers/Login/LoginViewController.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ - (UIView *)customFooterView{
342342
});
343343
[_underLoginBtn addTarget:self action:@selector(underLoginBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
344344

345+
_underLoginBtn.hidden = ![self p_canOpenWeiXin];
346+
345347
UIButton *cannotLoginBtn = ({
346348
UIButton *button = [UIButton new];
347349
[button.titleLabel setFont:[UIFont systemFontOfSize:14]];
@@ -586,4 +588,13 @@ - (void)p_thridPlatformLogin:(UMSocialResponse *)resp{
586588
}];
587589
}
588590

591+
#pragma mark - app url
592+
- (BOOL)p_canOpenWeiXin{
593+
return [self p_canOpen:@"weixin://"];
594+
}
595+
596+
- (BOOL)p_canOpen:(NSString*)url{
597+
return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:url]];
598+
}
599+
589600
@end

0 commit comments

Comments
 (0)