0

I'm trying to have it setup to open an app from within the current app, if not go to the app store and download it. I know it involves URLSchemes, I did see this post: Launch App from within App

But it seems like they are referring to apps you already created. The app wanting to open is not my own app but a bike app: https://apps.apple.com/us/app/biketownpdx/id1132076989

I can access the url with:

if let url  = URL(string: https://apps.apple.com/us/app/biketownpdx/id1132076989)
        {
            if UIApplication.shared.canOpenURL(url)
            {
                UIApplication.shared.open(url)
            }
        }
    }

But am not completely sure how to open it if its already installed on my device.

SwiftyJD
  • 5,257
  • 7
  • 41
  • 92
  • Does this answer your question? [Launch an app from within another (iPhone)](https://stackoverflow.com/questions/419119/launch-an-app-from-within-another-iphone) – Gimme the 411 Apr 28 '20 at 00:39
  • @Gimmethe411 I referred that post in this post, there is more detail to question asked here – SwiftyJD Apr 28 '20 at 00:40

1 Answers1

1
   if UIApplication.shared.canOpenURL(other app scheme)
    {
         UIApplication.shared.open(other app scheme)
     }else {
         UIApplication.shared.open(AppStore url)
    }
J.Doe
  • 86
  • 1
  • 5