2017-08-09 70 views
1

通常我会使用某种公共URL从另一个应用程序中打开应用程序,但我得到的所有应用程序都是我打开的应用程序的捆绑ID。有没有办法做到这一点?这是从应用程序中我用打开的应用程序之外的功能:通过使用捆绑包标识从内部打开应用程序

var appStoreURL: URL? 

func openAppFromMenu(inAppURL: URL?, appStoreURL: URL?) { 

if inAppURL != nil { 

    if let inApp = inAppURL { 
     if UIApplication.shared.canOpenURL(inApp) 
     { 
      UIApplication.shared.openURL(inApp) 
     } else { 
      //redirect to safari because the user doesn't have in app 
      print("App not installed") 
      self.appStoreURL = appStoreURL 
      addAlert() 

     } 
    } 
} else { 
    //redirect to safari because the user doesn't in app 
    print("App not installed") 
    self.appStoreURL = appStoreURL 
    addAlert() 
} 

}

+0

[在线查询](http://www.gotschemes.com/)为所述应用程序的URL方案,请联系作者或尝试[逆向工程](http://resources.infosecinstitute.com/ios -application-security-part-30-attacks-url-schemes /) – nathan

回答

0

没有,如果应用程序是不是在你的应用程序组,它不具有公共URL,你无法打开它。

+0

你在我的应用程序组中是什么意思。我们可以访问应用程序以及创建它们的人 – SwiftyJD

+0

然后让他们创建URL方案。 – Slayter