Monday, 29 October 2018

Safari cannot open the page - The error was, "The URL can't be shown" - related to Deeplinks?

So I am trying to use deeplinks in an iOS app like so (note, domain here is a dummy value):

static let redirectUrlStr = "domain://domain:success"

And

private let redirectUrl = URL(string: .redirectUrlStr)!

And I am passing this as a redirect to an AppAuth request:

let request = OIDTokenRequest(configuration: config!,
                              grantType: .refreshGrantType,
                              authorizationCode: nil,
                              redirectURL: self.redirectUrl,
                              clientID: .clientId,
                              clientSecret: nil,
                              scopes: [OIDScopeOpenID, OIDScopeProfile, OIDScopeEmail],
                              refreshToken: userCredentials.refreshToken,
                              codeVerifier: nil,
                              additionalParameters: nil)

This part all seems to work, and if I pass in a redirect URL like google.com, the redirect to google works.

However when attempting to use deeplinking I get the above error.

Now I think this should work -

I've got associated domains enabled in the capabilities portion of Xcode as such:

applinks:domain.com

And I have associated domains enabled in the App ID on Apple Developer

What is missing here? Do I need an apple-app-site-association file?

I've only worked with deeplinking once before so I'm not too clear on what I might be missing.

There is also an entitlements file with the associated domain information too.



from Safari cannot open the page - The error was, "The URL can't be shown" - related to Deeplinks?

No comments:

Post a Comment