Browse Source

1.修复 分享冷启动进去下载返回拉流失败问题

huangxiaodong 1 year ago
parent
commit
273b91a967
1 changed files with 23 additions and 1 deletions
  1. 23 1
      创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

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

@@ -56,6 +56,9 @@
 
 @property(nonatomic, copy)   NSString *getShareStr;//拿到分享的字符串
 
+//冷启动分享跳入用
+@property(nonatomic, strong)   UISceneSession *session;
+@property(nonatomic, strong)   UISceneConnectionOptions *connectionOptions;
 @end
 
 @implementation SceneDelegate
@@ -96,7 +99,14 @@
         
         //冷启动
         if(connectionOptions.URLContexts != nil){
-            [self scene:scene openURLContexts:connectionOptions.URLContexts];
+            _session = session;
+            _connectionOptions = connectionOptions;
+            
+//            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+//                mainBlock(^{
+//                    [self scene:scene openURLContexts:connectionOptions.URLContexts];
+//                });
+//            });
         }
     }
 }
@@ -298,6 +308,10 @@
                         playerRootVC.isPwdVCShow = NO;
                         [playerRootVC setShowImgAndVoiceTypeFun:YES];
                         [weakSelf shareAwakenAppBy:weakSelf.getShareStr];
+                    
+                        if(self->_session && self->_connectionOptions){
+                            [self scene:self->_session openURLContexts:self->_connectionOptions.URLContexts];
+                        }
                 });
             });
         }
@@ -458,6 +472,9 @@
         //NSLog(@"context.options.sourceApplication ===== %@",context.options.sourceApplication);
         
     }
+    
+    _session = nil;
+    _connectionOptions = nil;
 }
 
 - (void)delayedHandlShareAwakenAppBy:(NSString*)curStr{
@@ -663,6 +680,10 @@
         [_inputVC.view removeFromSuperview];
     }
     _isDidShowPwdType = NO;
+    
+    if(self->_session && self->_connectionOptions){
+        [self scene:self->_session openURLContexts:self->_connectionOptions.URLContexts];
+    }
 }
 
 - (NSString *)documentPathForAccount:(NSString *)account fileFolder:(NSString *)fileFolder {
@@ -1177,6 +1198,7 @@
         
         [[UIApplication sharedApplication] setStatusBarHidden:NO];
         [_curPlayerVC.navigationController pushViewController:vc animated:YES];
+        _curPlayerVC.isNeedRecyclResource = NO;
     }
 }
 @end