I want to login to Facebook and redirect to my app but I have a problem. There is my code:
let oauthswift = OAuth2Swift(
consumerKey: "4242424242",
consumerSecret: "",
authorizeUrl: "https://www.facebook.com/dialog/oauth",
accessTokenUrl: "https://graph.facebook.com/oauth/access_token",
responseType: "code"
)
oauthswift.authorizeURLHandler = SafariURLHandler(viewController: self, oauthSwift: oauthswift)
let state = generateState(withLength: 20)
guard let rwURL = URL(string:"https://myapp.test/callback/facebook") else { return }
let _ = oauthswift.authorize( withCallbackURL:rwURL, scope: "public_profile", state: state,
success: { credential, response, parameters in
..........}
Bundle is ID is myapp.test
Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp.test</string>
</array>
</dict>
</array>
When I try to redirect into my app "Safari cannot open the page because the server cannot be found"
In developers.facebook.com page in the section "Valid OAuth redirect URIs" I have same url "https://myapp.test/callback/facebook". What I am doing wrong? Thank you.