Browse Source

唤起抖音相关

apple 5 years ago
parent
commit
186fedcced

+ 2 - 2
ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj

@@ -1056,7 +1056,7 @@
 				CODE_SIGN_ENTITLEMENTS = JianYuIOS/JianYuIOS.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 50;
+				CURRENT_PROJECT_VERSION = 51;
 				DEVELOPMENT_TEAM = 4S438G3ZUL;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -1140,7 +1140,7 @@
 				CODE_SIGN_ENTITLEMENTS = JianYuIOS/JianYuIOS.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 50;
+				CURRENT_PROJECT_VERSION = 51;
 				DEVELOPMENT_TEAM = 4S438G3ZUL;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -142,7 +142,7 @@ _Pragma("clang diagnostic pop")\
 
 //#define kHost @"http://web-jydev-zyh.jianyu360.cn/" //张雨涵
 
-#define kHost @"http://web-jydev-wcj.jianyu360.cn/" //王传近
+//#define kHost @"http://web-jydev-wcj.jianyu360.cn/" //王传近
 
 //#define kHost @"http://web-jydev-wky.jianyu360.cn/" //王凯悦
 
@@ -163,7 +163,7 @@ _Pragma("clang diagnostic pop")\
 //#define kHost @"http://app2-jytest.jianyu360.cn/"  //测试http
 //#define kHost @"https://app2-jytest.jianyu360.cn/" //测试https
 
-//#define kHost @"http://app-i1.jianyu360.com/"   //新正式
+#define kHost @"http://app-i1.jianyu360.com/"   //新正式
 
 
 

+ 42 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewExpViewController.m

@@ -81,6 +81,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
                            @"skipAlbum",
                            @"openActivityPage",
                            @"callPhone",
+                           @"openOtherAppLinks",
                            @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
@@ -276,6 +277,8 @@ NSString *const new_AesKey_3 = @"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 {
@@ -809,9 +812,46 @@ NSString *const new_AesKey_3 = @"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

+ 43 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewMineViewController.m

@@ -94,6 +94,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
                            @"skipAlbum",
                            @"openActivityPage",
                            @"callPhone",
+                           @"openOtherAppLinks",
                            @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
@@ -291,6 +292,8 @@ NSString *const new_AesKey_4 = @"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 {
@@ -827,9 +830,47 @@ NSString *const new_AesKey_4 = @"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

+ 44 - 28
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -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 {

+ 42 - 3
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSubViewController.m

@@ -89,6 +89,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
                            @"skipAlbum",
                            @"openActivityPage",
                            @"callPhone",
+                           @"openOtherAppLinks",
                            @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
@@ -282,6 +283,8 @@ NSString *const new_AesKey_2 = @"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 {
@@ -818,12 +821,48 @@ NSString *const new_AesKey_2 = @"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

+ 2 - 5
ios/JianYuIOS/JianYuIOS/Info.plist

@@ -60,9 +60,7 @@
 			<key>CFBundleURLName</key>
 			<string></string>
 			<key>CFBundleURLSchemes</key>
-			<array>
-				<string>snssdk1128</string>
-			</array>
+			<array/>
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
@@ -80,9 +78,8 @@
 		<string>weixin</string>
 		<string>mqqapi</string>
 		<string>mqq</string>
-		<string>douyinopensdk</string>
-		<string>douyinsharesdk</string>
 		<string>snssdk1128</string>
+		<string>gifshow</string>
 	</array>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>