How can I succeed OAuth for iOS home screen web app?

I am using accounts-twitter in my app and want to use my app as iOS web clip (full screen web app via home screen icon).

Thanks to developers’ efforts, now there are no pop up window for Twitter in Safari, web app is redirected to Twitter page.

After authentication, web app is redirected to the page “Login completed. Click here to close window”.
And when I click “Click here”, Safari will be invoked and show the web app.
And reinvoking web clip shows that authentication falis.

How can I pass through the last stage?

1 Like

This is actually a known problem with iOS. If you are an Apple developer you can read about the issue here.
If you aren’t an Apple developer then you can read about the issue on stackoverflow here.

The only workaround is to change your loginStyle to "redirect" which isn’t the best solution either because then you will lose your ability to do anything in the login callback. Apple really dropped the ball with this bug.

Thank you, khamoud-san!

‘redirect’ method sounds good for workaround, but actually I fails to use ‘redirect’ method.
I made sure empty callback URL in Twitter’s app management page, but ‘redirect’ method fails and outputs the following error in server.

Error in OAuth Server: Failed to send OAuth1 request to https://api.twitter.com/oauth/request_token. failed [401] <?xml version="1.0" encoding="UTF-8"?> Desktop applications only support the oauth_callback value ‘oob’ /oauth/request_token

Anyway, thank you that you let me know it is a known problem.

1 Like