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

iOS error when opening link in APP_DOMAIN #28

Open
jacobg opened this issue Feb 3, 2019 · 13 comments
Open

iOS error when opening link in APP_DOMAIN #28

jacobg opened this issue Feb 3, 2019 · 13 comments

Comments

@jacobg
Copy link

jacobg commented Feb 3, 2019

I'm doing a basic proof-of-concept in iOS simulator. I've created my dynamic link as follows (anonymizing my app name here):
https://example.page.link/abc => https://example.com/123

If I open the link "https://example.page.link/abc", then the link opens my app and I can get the url data via the onDynamicLink link. All is good in this case.

But if I open the link "https://example.com/123" (app installed), then the app also does open, but I don't get the event. Even worse, I get an EXC_BAD_ACCESS error with an infinite recursion loop on the AppDelegate(FirebaseDynamicLinksPlugin) identity_application function going over 40,000 stack frames deep. See attached screenshots of stacktrace below. Now, perhaps that isn't supported, but then why does the plugin.xml add an entitlement for applinks:APP_DOMAIN? And certainly it shouldn't crash like this.

Am I doing something wrong?

screen shot 2019-02-03 at 11 43 21 am

screen shot 2019-02-03 at 12 00 14 pm

@jacobg
Copy link
Author

jacobg commented Feb 3, 2019

I think the recursion loop may be due to GoogleUtilities also swizzling the selector:
@selector(application:continueUserActivity:restorationHandler:);
So there's a 3 way infinite recursion loop of swizzling.

Perhaps this is a regression from a more recent version of Firebase/Core?

Here is a page that explains how to register an interceptor which relies on GoogleUtilities swizzling:
https://github.com/firebase/firebase-ios-sdk/tree/master/GoogleUtilities/AppDelegateSwizzler

@jacobg
Copy link
Author

jacobg commented Feb 4, 2019

It seems that the swizzling should be removed, and AppDelegate selector declared straight up. Are you concerned about another plugin also using that delegate selector? I don't think that would work anyway with the way the Firebase SDK does its own swizzling.

Also, I'm still wondering how you would support posting an APP_DOMAIN url to javascript, since this plugin does declare its capability?

@nparziale
Copy link

Hi @jacobg any updates on this issue?
Thanks!

@jacobg
Copy link
Author

jacobg commented Apr 25, 2019

I pulled this plugin into my own application repo, and changed it to remove swizzling and to also handle links that firebase does not handle. If @chemerisuk will accept PR's for those changes, I'll submit them.

@nparziale
Copy link

nparziale commented Apr 25, 2019 via email

@jacobg
Copy link
Author

jacobg commented Apr 25, 2019

I'd rather just submit a PR if @chemerisuk will accept them. It affects both iOS and Android.

@nparziale
Copy link

Hi @jacobg any updates on this?

@jacobg
Copy link
Author

jacobg commented May 24, 2019

Waiting on @chemerisuk to say if he'll accept a PR.

@nparziale
Copy link

nparziale commented May 24, 2019 via email

@takedasoft
Copy link

I have solved the same problem. If you use custom domain,
how about you try checking "FirebaseDynamicLinksCustomDomains" in YourApp-info.plist.

more info:
https://firebase.google.com/docs/dynamic-links/ios/receive#open-dynamic-links-in-your-app

@nparziale
Copy link

Hi @takedasoft do dynamic links work for you on iOS cold starts? In my case the deepLink result is lost because of handleOpenUrl being called after the initial resolveDeepLink

@adamduren
Copy link

Same issue here

@chemerisuk chemerisuk pinned this issue Sep 18, 2019
@mark-veenstra
Copy link

mark-veenstra commented Oct 21, 2019

When using custom domains for Dynamic Links you could adjust this plugin.xml and add:

        <config-file target="*-Info.plist" parent="FirebaseDynamicLinksCustomDomains">
            <array>
                <string>https://$PAGE_LINK_DOMAIN</string>
                <string>http://$PAGE_LINK_DOMAIN</string>
            </array>
        </config-file>

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

5 participants