Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with Facebook plugin on iOS #478

Closed
sebaferreras opened this issue Jul 11, 2018 · 25 comments
Closed

Conflict with Facebook plugin on iOS #478

sebaferreras opened this issue Jul 11, 2018 · 25 comments
Assignees

Comments

@sebaferreras
Copy link

Hello!

In our app we need to support both universal links (like https://foo.app.link/bar?campaign=95) and the old deep links (like foobar://campaign/95).

Universal links are working great for both Android and iOS.

When we open a deep link on Android, the Branch plugin shows that deep link in a property called +non_branch_link, which is expected, so this scenario is working fine as well.

branch android

But this does not work well on iOS, because of a conflict with the Facebook Cordova plugin. In the screenshot below, you can notice that the Facebook plugin gets the deep link information, prints a log in the console, and then for some reason the Branch plugin is not being able to get that deep link anymore and the +non_branch_link is empty:

not working

If I comment that openURL method (since we use Facebook only for tracking some in-app events, but not for allowing users to login, where I guess that openURL event is used) I can confirm that the Branch plugin is being able to get the +non_branch_link property with the deep link:

working

I'm not familiar with iOS native development at all, so maybe there's something in the way the Facebook plugin handles the deep link that causes the issue and it's obvious, but unfortunately I'm not being able to understand what's going on there.


Steps to reproduce the issue:

  1. Clone the Branch ionic3 example app from its repo
  2. Install the Facebook Cordova plugin (don't need to initialize anything, by just installing the Facebook plugin you can reproduce the issue)
  3. Paste the deep link (something like urischeme://foo/1234) in Apple Notes
  4. Long press on the deep link (not 3D Touch). Click Open in "APP_NAME" to open your app
@KlaatuVerataNecto
Copy link

Yeah, this is one very annoying.

@ghost
Copy link

ghost commented Jul 11, 2018

Can confirm the issue as well.

@sequoiaat
Copy link
Contributor

Hi,

@sebaferreras Can you please mention the version that you're using? Like,

  1. branch SDK version
  2. Facebook plugin version
  3. Cordova/ionic versions

Thanks

@sebaferreras
Copy link
Author

@sequoiaat of course! We're using:

branch-cordova-sdk: 3.0.0
cordova-plugin-facebook4: 2.2.0
// Ionic info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : android 6.3.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2
    ios-sim           : 5.0.8
    Node              : v8.11.1
    npm               : 5.6.0
    OS                : macOS High Sierra
    Xcode             : Xcode 9.4.1 Build version 9F2000

@sequoiaat sequoiaat self-assigned this Jul 16, 2018
@sequoiaat
Copy link
Contributor

@sebaferreras We are not seeing the issue, non-branch link is not empty. Followed your steps and made sure exact version no.s of all packages. We just installed Facebook cordova plugin. Are you sure no need to initialize it?

Thanks

@sebaferreras
Copy link
Author

@sequoiaat are you testing that on an iOS device? Because it works properly on Android, but not for iOS

@sequoiaat
Copy link
Contributor

@sebaferreras Yes, iOS device

@sebaferreras
Copy link
Author

@sequoiaat is there any way that I can access to that test project, in order to see if I can reproduce the issue with it? If not, please let me know and I'll create a demo using a new branch account and a new facebook app and I'll give you access to that repo.

@sequoiaat
Copy link
Contributor

@sebaferreras
We tried to reproduce it in the example app(https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/tree/master/examples/ionic3) and added the Facebook Cordova plugin into it.
It will be great if you could share your demo app.

@sebaferreras
Copy link
Author

@sequoiaat I'm very sorry for such a delay, today I'll create a demo app so you can reproduce the issue on your end. Thanks.

@sebaferreras
Copy link
Author

@sequoiaat I've created this Github project where you can reproduce the issue.

I've also recorded the following video using that project where you can see how I was able to reproduce the issue and then I was able to fix it by commenting a method from the Facebook plugin: https://www.dropbox.com/s/o4i7k2zbdigdabo/Branch%20Issue.mov?dl=0

ionic info

Ionic:

   ionic (Ionic CLI)  : 4.0.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.9

Cordova:

   cordova (Cordova CLI) : 7.1.0
   Cordova Platforms     : ios 4.5.4

System:

   Android SDK Tools : 26.1.1
   ios-deploy        : 1.9.2
   ios-sim           : 5.1.0
   NodeJS            : v8.11.1 (/usr/local/bin/node)
   npm               : 5.10.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000

Environment:

   ANDROID_HOME : /Users/sebastian/Developer/Android/

@sequoiaat
Copy link
Contributor

@sebaferreras We are unable to reproduce this issue after following the exact steps your mentioned. The only difference we had was we were using the latest versions. Can you please try with the branch SDK version 3.0.1 and Facebook SDK version 2.4.0 instead of 2.2.0

@paulstelzer
Copy link
Contributor

@sebaferreras did you get it working now on iOS? I think they have an issue there

@sequoiaat
Copy link
Contributor

@sebaferreras @paulstelzer We are working on this for a possible solution as we were able to reproduce this issue.

@sequoiaat
Copy link
Contributor

@sebaferreras @paulstelzer - We have been able to trace the issue down . When using FacebookPlugin, it is not triggering AppDelegate+BranchSdk.m class. It goes to FacebookConnectPlugin.m class openURl() and directly enters into Cordova AppDelegate
Methods which is why it fails . We are trying to handle this and release a fix

@sebaferreras
Copy link
Author

Thank you so much for your support @sequoiaat!

@noahcooper
Copy link

Any update on this?

@sequoiaat
Copy link
Contributor

@noahcooper @sebaferreras @paulstelzer . We have pushed a PR to fix this issue . Once tested and approved it should solve the problem. - this is the PR #521

@sequoiaat
Copy link
Contributor

sequoiaat commented Dec 13, 2018

@sebaferreras @paulstelzer Can we close this one as @sean-browze confirmed that the new role out addressed this issue.

@csalmi-branch
Copy link
Contributor

@sebaferreras Are you still experiencing this issue?

@sebaferreras
Copy link
Author

@sequoiaat, @csalmi-branch I'll be testing this today/tomorrow and will get back to you. Thanks!

@faisalcom
Copy link

same issue until now its conflict

@csalmi-branch
Copy link
Contributor

@faisalcom Could you please explain your statement? Does this fix not work for you?

@csalmi-branch
Copy link
Contributor

@sebaferreras and @faisalcom, if you are still experiencing this issue, could you please let us know which version you are using?

@csalmi-branch
Copy link
Contributor

I am closing this issue. If a problem still is occurring, please submit a support ticket or open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants