소스 검색

1.修复冷启动 iOS url scheme 唤醒APP 第一次不走openURLContexts

huangxiaodong 1 년 전
부모
커밋
c0ec001ce3
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

+ 9 - 2
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -93,6 +93,11 @@
         [self.window makeKeyAndVisible];
         
         ksharedAppDelegate.window = self.window;
+        
+        //冷启动
+        if(connectionOptions.URLContexts != nil){
+            [self scene:scene openURLContexts:connectionOptions.URLContexts];
+        }
     }
 }
 
@@ -447,9 +452,11 @@
             [self delayedHandlShareAwakenAppBy:curStr];
             break;
         }
-        
+        else{
+            [WXApi handleOpenURL:context.URL delegate:self];
+        }
         //NSLog(@"context.options.sourceApplication ===== %@",context.options.sourceApplication);
-        [WXApi handleOpenURL:context.URL delegate:self];
+        
     }
 }