iOS 如何使用Safari瀏覽器打開app


1.首先在info.plist添加一個鍵值對,如下圖


2.在appdelegate.m文件如下方法寫代碼

  1. -(BOOL)application:(UIApplication*)app openURL:(NSURL*)url options:(NSDictionary<NSString*,id>*)options{  
  2.     if (url) {  
  3.         UIAlertView *alertView = [[ UIAlertView alloc] initWithTitle:nil message:@"你喚醒了您的應用" delegate:self cancelButtonTitle:@"確定" otherButtonTitles : nil , nil ];  
  4.         [alertView show];  
  5.     }  
  6.     return YES ;  

3.在Safari瀏覽器輸入myApp:// ,就可以啟動應用了,在Safari瀏覽器測試通過


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM