|
@@ -96,6 +96,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
@"skipAlbum",
|
|
|
@"openActivityPage",
|
|
|
@"callPhone",
|
|
|
+ @"openOtherAppLinks",
|
|
|
@"inPurchasingVip",
|
|
|
];
|
|
|
for (NSString*jsName in jsArr) {
|
|
@@ -297,6 +298,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self jsOpenActivityPage:message.body];
|
|
|
}else if ([message.name isEqualToString:@"callPhone"]) {
|
|
|
[self jsCallPhone:message.body];
|
|
|
+ }else if ([message.name isEqualToString:@"openOtherAppLinks"]) {
|
|
|
+ [self jsOpenOtherAppLinks:message.body];
|
|
|
}else if ([message.name isEqualToString:@"inPurchasingVip"]) {
|
|
|
[self jsInPurchasingVip:message.body];
|
|
|
}else {
|
|
@@ -488,32 +491,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
|
|
|
|
|
|
|
|
|
- [self performSelector:@selector(rrrrrrr) withObject:nil afterDelay:5];
|
|
|
-}
|
|
|
--(void)rrrrrrr {
|
|
|
- //测试跳转抖音
|
|
|
- NSURL *url = [NSURL URLWithString:@"snssdk1128://aweme/live"];
|
|
|
- if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
|
|
- if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
|
|
|
- //iOS 10.0+
|
|
|
- NSLog(@"iOS 10+");
|
|
|
- if (@available(iOS 10.0, *)) {
|
|
|
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
|
|
|
- }];
|
|
|
- } else {
|
|
|
- // Fallback on earlier versions
|
|
|
- [[UIApplication sharedApplication] openURL:url];
|
|
|
- }
|
|
|
- [[UIApplication sharedApplication] openURL:url];
|
|
|
- }else{
|
|
|
- NSLog(@"iOS 2~10");
|
|
|
- //iOS 2~10
|
|
|
- [[UIApplication sharedApplication] openURL:url];
|
|
|
- }
|
|
|
- }else{
|
|
|
- //一般是没有安装
|
|
|
- NSLog(@"跳转下载app链接");
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1078,10 +1056,48 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
-(void)jsCallPhone:(NSDictionary *)dict {
|
|
|
NSString *phone = [NSString stringWithFormat:@"%@",dict[@"phone"]];
|
|
|
NSMutableString *tel = [[NSMutableString alloc]initWithFormat:@"telprompt://%@",phone];
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ if (@available(iOS 10.0, *)) {
|
|
|
+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:tel] options:@{} completionHandler:^(BOOL success) {
|
|
|
+ }];
|
|
|
+ } else {
|
|
|
+ // Fallback on earlier versions
|
|
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:tel]];
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
+//打开其他app 抖音+快手
|
|
|
+-(void)jsOpenOtherAppLinks:(NSDictionary *)dict {
|
|
|
+ //测试跳转抖音--快手 @"gifshow://" @"snssdk1128://"
|
|
|
+ NSString *appLink = [NSString stringWithFormat:@"%@",dict[@"appLink"]];
|
|
|
+ NSString *appName = [NSString stringWithFormat:@"%@",dict[@"appName"]];
|
|
|
+ NSLog(@"appName:%@",appName);
|
|
|
+ NSURL *url = [NSURL URLWithString:appLink];
|
|
|
+ if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
|
|
+ if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
|
|
|
+ //iOS 10.0+
|
|
|
+ NSLog(@"iOS 10+");
|
|
|
+ if (@available(iOS 10.0, *)) {
|
|
|
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
|
|
|
+ if (!success) {
|
|
|
+ [[LXDataBaseManager shareDataBaseManager]showHudOnlyText:appName delay:2];
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ } else {
|
|
|
+ // Fallback on earlier versions
|
|
|
+ [[UIApplication sharedApplication] openURL:url];
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ NSLog(@"iOS 2~10");
|
|
|
+ //iOS 2~10
|
|
|
+ [[UIApplication sharedApplication] openURL:url];
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //一般是没有安装
|
|
|
+ NSLog(@"跳转下载app链接");
|
|
|
+ [[LXDataBaseManager shareDataBaseManager]showHudOnlyText:appName delay:2];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
//内购VIP
|
|
|
-(void)jsInPurchasingVip:(NSDictionary *)dict {
|