Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oauth suddenly not working on iphone (with FS app installed only)

Our iphone app allows for sign in via Foursquare via oauth. It was working fine and recently stopped working.

The error we get is: Connecting Failure: Callback uri is not valid for this consumer.

HOWEVER, if the user does not have the foursquare app installed on their phone it works fine as before. It seems as if FS is now doing a redirect to handle the oauth inside the FS app and this fails when attempting to return to the originating application. Via safari it seems to work.

This is on ios 9.

Solutions?? Thanks!

enter image description here

like image 307
Udi Avatar asked Oct 23 '15 19:10

Udi


2 Answers

We've changed to use a SafariViewController and this seems to force Foursquare to not to this strange in-app redirect, solving the issue. This is also Apple's preferred oauth method, so probably the way to go.

Still seems like a problem on the Foursquare side that they may want to address for others however. I'm closing this question. Thanks.

like image 150
Udi Avatar answered Sep 29 '22 08:09

Udi


Where does your redirect URL point? If you want it to launch your app after completion you should point to the iTunes store (pre-iOS9) link for your app or the universal link (iOS9 onwards).

More information on redirects for the native foursquare app is available in the README here: https://github.com/foursquare/foursquare-ios-oauth/

How to create a universal link in iOS9 https://www.appsflyer.com/blog/how-to-set-up-ios-9-universal-links-for-your-app/

like image 40
Aidan Gomez Avatar answered Sep 29 '22 08:09

Aidan Gomez