cordova-plugin-firebase-dynamiclinks icon indicating copy to clipboard operation
cordova-plugin-firebase-dynamiclinks copied to clipboard

iOS error when opening link in APP_DOMAIN

Open jacobg opened this issue 6 years ago • 13 comments

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 avatar Feb 03 '19 16:02 jacobg

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 avatar Feb 03 '19 19:02 jacobg

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?

jacobg avatar Feb 04 '19 12:02 jacobg

Hi @jacobg any updates on this issue? Thanks!

nparziale avatar Apr 25 '19 03:04 nparziale

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.

jacobg avatar Apr 25 '19 11:04 jacobg

Any chance you can share the updated plugin?

On 25 Apr 2019, at 08:33, jacobg [email protected] wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

nparziale avatar Apr 25 '19 13:04 nparziale

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

jacobg avatar Apr 25 '19 16:04 jacobg

Hi @jacobg any updates on this?

nparziale avatar May 24 '19 18:05 nparziale

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

jacobg avatar May 24 '19 18:05 jacobg

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

takedasoft avatar May 28 '19 17:05 takedasoft

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

nparziale avatar May 29 '19 17:05 nparziale

Same issue here

adamduren avatar Sep 17 '19 18:09 adamduren

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>

mark-veenstra avatar Oct 21 '19 15:10 mark-veenstra