瀏覽代碼

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];
+        
     }
 }