Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sign in with Linkedin doesn't trigger callback on iOS Safari when using the JS API

I'm using SignIn with Linkedin on a website, via the JS API. It works fine on the few desktop browsers I've tested (Chrome and FF on Windows, Safari on MacOS), and on a slightly outdated Android Chrome. But it fails on iOS Safari (I use iOS 7).

The issue is that on iOS Safari, the callback passed as argument to IN.User.authorize is not executed.

The line looks like this: IN.User.authorize(this._getProfileData, this);

_getProfileData is executed on the desktop browsers mentioned above and Android Chrome, but not iOS Safari.

This issue can even be reproduced without iOS: via Chrome's developer tools, in device mode for iPhones and iPads.

Any clues?

like image 540
Blackbird Avatar asked Mar 24 '15 10:03

Blackbird


1 Answers

Unfortunately, LinkedIn's JS SDK is incompatible with iOS 5+ due to the way that Javascript is paused during cross-window communication processes. You will need to fall back to server-side REST calls to ensure 100% platform compatibility.

like image 83
Justin Kominar Avatar answered Sep 20 '22 15:09

Justin Kominar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!