M
M
Maxim Trofimov2017-02-06 15:07:25
Objective-C
Maxim Trofimov, 2017-02-06 15:07:25

How to make a transition to a previously installed application, if it is not there, then follow the link to it in the AppStore?

I’m writing in swift 3.0 I’m
interested in switching to a previously installed application, that is, you press a button and go, say, to a contact messenger, and if it’s not worth it (contact messenger), then follow the link to transfer to the app store (where you can download it).
Problemma arises in that that I do not work conditions (namely else), To check up whether there was a cost or not. But only the first action that you set is performed, or the transition to the store or application.
let MyAppSchema = URL(string: "myappschema://")

UIApplication.shared.open(MyAppSchema!, options: [:], completionHandler: nil)

let MyAppUrl = URL(string: " https://itunes.apple.com/blah blah ")
UIApplication.shared.open(MyAppUrl!, options: [:], completionHandler: nil)

Everything is entered in info.plist accordingly. Tell me how to get out of this situation, maybe I missed something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
ManWithBear, 2017-02-06
@ManWithBear

https://developer.apple.com/reference/uikit/uiappl...
func canOpenURL(_ url: URL) -> Bool

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question