Slow Death
Slow Death

Reputation: 31

Deeplink created using ionic and capacitor is not working

AndroidManifest.xml

<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">

    <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:name="io.ionic.starter.MainActivity" android:label="@string/title_activity_main" android:theme="@style/AppTheme.NoActionBarLaunch" android:launchMode="singleTask">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter android:label="DeepLink" android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" android:host="fundcore-testapp.azurewebsites.net" />
        </intent-filter>

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" android:host="fundcore-testapp.azurewebsites.net" />
        </intent-filter>

    </activity>

    <provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
    </provider>
</application>

<!-- Permissions -->

<uses-permission android:name="android.permission.INTERNET" />

assetlinks.json

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target" : { "namespace": "android_app", "package_name": "com.beyond.app",
               "sha256_cert_fingerprints": ["my key"] }
}]

I have deployed assetlinks.json to the https website. I have created an anchor tag on codepen that points to the page ie the https site . When I open the codepen on mobile and click the anchor tag it doesnt open my app

Upvotes: 2

Views: 3299

Answers (1)

Michele Ordile
Michele Ordile

Reputation: 146

I checked your link https://fundcore-testapp.azurewebsites.net/.well-known/assetlinks.json the information returned is correct and I would exclude a configuration problem, also as happened in the comments remove the useless intent and leave it alone

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https" android:host="fundcore-testapp.azurewebsites.net" />
</intent-filter>

Also to help you it would be helpful if you publish your capacitor related code, if you use Angular note the use of NgZone from '@angular/core' as described in the documentation https://capacitorjs.com/docs/guides/deep-links to manage the url received. Although it is obvious also check your "applicationId" in the build.gradle file which matches the one specified in assetlinks.json and update @capacitor/app to the latest version available based on what you are using

Upvotes: 1

Related Questions