ios9 - Deep linking redirect to app only works on 2nd attempt on iOS 9 and up only -


i have strange redirect app issue our login system in ios 9 only.

now, have abitrary payload allowed , url schemes setup in plist file.

what happens this:

  • a user brought sfsafariviewcontroller login facebook/google
  • the user enters credentials (or not if cached)
  • instead of being redirected our app, user stuck on blank page if credentials cached, or stuck on final google/facebook login page. no "open in app" dialog appears , openurl appdelegate function not called.

now, if user closes sfsafariviewcontroller, comes our in app login page , attempt login again 2nd time, redirect app works every time there , openurl appdelegate method called each time.

do note on ios9, redirected outside app safari complete login process (instead of using sfsafariviewcontroller) , had same issue whereas "open in app" popup redirect app shown on 2nd login attempt , up.

this happening on ios 9 only. on ios 8, issue not appear , our users redirected app after login in.

the redirect url sent app after oauth login same on first login attempt , up.

has gotten such problem on ios 9?

as have mentioned regarding facebook,

  1. first, guess missing call of fbsdkapplicationdelegate's application:openurl:sourceapplication:annotation: uiapplicationdelegate's application:openurl:options:

  2. you may missing line nsurl *url = [launchoptions objectforkey:uiapplicationlaunchoptionsurlkey]; in uiapplicationdelegate's didfinishlaunchingwithoptions

  3. cross check have followed setup mentioned in https://developers.facebook.com/docs/ios/ios9

  4. if device jailbreak in ios 9.0.2 cause url scheme issue.

solution worked me below lines of code, have both fb /g+ integrated in app same yours:-

- (bool)application:(uiapplication *)app openurl:(nsurl *)url options:(nsdictionary<nsstring*, id> *)options {     return [[fbsdkapplicationdelegate sharedinstance] application:app                                                           openurl:url                                                 sourceapplication:options[uiapplicationopenurloptionssourceapplicationkey]                                                        annotation:options[uiapplicationopenurloptionsannotationkey]]             || [[gidsignin sharedinstance] handleurl:url                                    sourceapplication:options[uiapplicationopenurloptionssourceapplicationkey]                                           annotation:options[uiapplicationopenurloptionssourceapplicationkey]]; } - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation {          return [[fbsdkapplicationdelegate sharedinstance] application:application                                                           openurl:url                                                 sourceapplication:sourceapplication                                                        annotation:annotation                  ] ||                 [[gidsignin sharedinstance] handleurl:url                                           sourceapplication:sourceapplication                                                  annotation:annotation];    } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -