nativescript-urlhandler icon indicating copy to clipboard operation
nativescript-urlhandler copied to clipboard

apple-app-site-association / applinks

Open philipmclifton opened this issue 5 years ago • 10 comments

Does this plugin work with applinks (apple-app-site-association).

I have my app loading with myapp:// and your plugin works perfectly.

I'm really struggling to find anything on the internet as to how to find out what deep link opened the app.

Hopefully I'm not wasting your time with this questions and you might know of something.

philipmclifton avatar Jan 02 '19 23:01 philipmclifton

I have the same issue here. the callback is actually not triggered at all. @philipmclifton, did you find anything relevant?

red-0ne avatar Feb 01 '19 11:02 red-0ne

I am finding that I can get this to work by making the following change to the urlHandler.ios.ts

enableMultipleOverridesFor(
    appDelegate,
    'applicationContinueUserActivityRestorationHandler', // changed this from continueUserActivity
    function (
        application: UIApplication,
        userActivity: NSUserActivity
    ): boolean {
        if (userActivity.activityType === NSUserActivityTypeBrowsingWeb) {

            let appURL = extractAppURL(userActivity.webpageURL);

            if (appURL !== null) {
                setTimeout(() => getCallback()(appURL));
            }
        }

        return true;
    });

I am not sure if this is going to cause any clashes at this stage. Still testing.

matthew-arosoftware avatar May 31 '19 06:05 matthew-arosoftware

thanks for the hint.

you can give [email protected] a try

hypery2k avatar May 31 '19 10:05 hypery2k

Hi @hypery2k , I have tried the new development version but it doesn't work for the universal link (app link). It works for deep link (both Android and iOS) though.

tr1et avatar Jun 01 '19 08:06 tr1et

okay, but is this the same behavior as before or fixes issues already?

Will look for the app link issue. I think the metadata is just missing: https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html

hypery2k avatar Jun 01 '19 10:06 hypery2k

It is the same issue as before (1.2.3), only iOS universal link doesn't work.

tr1et avatar Jun 01 '19 15:06 tr1et

I have the same issue on android so app link not working and the disambiguation dialog still showing.

<intent-filter
    android:autoVerify="true">
    <data
        android:scheme="https"
        android:host="my.host.com"
        android:pathPattern="/launchapp" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

alijmlzd avatar Jul 17 '19 11:07 alijmlzd

For anyone still struggling with this, I've made a new NS plugin specifically for universal links. https://www.npmjs.com/package/nativescript-plugin-universal-links

If you still need to support deep linking, you will need to use both.

sebestindragos avatar Mar 16 '20 10:03 sebestindragos

Hi @sebestindragos .

Do you happen to have a demo project on how to use your package? I'm trying to use it, but I'm kind stuck.

ronalson avatar Mar 23 '20 23:03 ronalson

@ronalson the package is fairly easy to use, the instructions are in the Readme. Open a new issue in the repo and I'll help you set it up.

sebestindragos avatar Mar 24 '20 11:03 sebestindragos