Capacitor v7
Android build
Followed Android configuration here: Deep Links | Capacitor Documentation
Verified statement list tester/generator was successful and placed on webserver.
Added intent filter to AndroidManifest.xml, however when following the instructions that show the following:
When I opted to add my own app name here, the following is thrown in logcat
android:name=“com.testapp.MainActivity”
“FATAL EXCEPTION: main Process: com.testapp.app, PID: 21352 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.testapp.app/com.testapp.MainActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.testapp.MainActivity” on path: DexPathList[[zip file “/data/app/~~5OpKnyA7L58sLKiQOuzeAw==/com.testapp.app-t1h_zqW6S9DtaxDiKM28TQ==/base.apk”],nativeLibraryDirectories=[/data/app/~~5OpKnyA7L58sLKiQOuzeAw==/com.testapp.app-t1h_zqW6S9DtaxDiKM28TQ==/lib/arm64, /system/lib64, /system/system_ext/lib64]]”
testappCapacitor doctor checks out OK
The app won’t compile. If you omit the above and leave it as it was which is:
android:name=“.MainActivity”
It will compile but deep linking still won’t work, despite everything being verified and implemented. Any ideas?
Yeah, it has to be .MainActivity
now, but that’s unrelated to deep links not working.
Did you change the intent-filter
to use your own domain instead of beerswift.app
?
I gathered that and reverted back to .MainActivity
I did use my own domain, the example beerswift.app is not used in my code.
I’ve just stumbled across this: Authentication in Ionic Angular with Supabase ( I am not using Angular )
Which seemingly works, but it’s very far off from the official documents for implementing deep linking, as you have to modify:
strings.xml in Android/app/src/main/res/values
to have
<string name="custom_url_scheme">testapp</string>
And you have to modify AndroidManifest.xml
<data android:scheme="@string/custom_url_scheme" />
<!-- <data android:host="com.testapp.app" /> -->
Then you add a link with testapp://someappurl
And it works and opens on the device as a deep link but is of no use as regular web browsers not on mobile can’t do anything with it.
So the expectation is to have url’s that match the domain from the statement list tester to actually open the app rather than opening the link in a browser still.
That is for custom schemes.
Custom schemes are like an ancient form of deep links that is discouraged because anybody could declare the same scheme on their app, so there is no guarantee that your app will open and not another that registered the same scheme.
Ok that may be so, but the documentation I followed for deeplinks, doesn’t produce the expected outcome, howver the custom scheme does.
Therefore how would one go about getting deep links to function as expected when after following the documentation, winds up not working?
The documentation worked last time I tried, it might have changed something since it was created, but you can always follow the official google docs since it’s not really a Capacitor specific thing other than installing the plugin for getting the launch url on javascript, but having the plugin installed is not needed for the deep links to work.
It must have, as it no longer works. Adding a link as you shared above, for others to follow to the official Capacitor documentation would help in the case that these doc’s fall out of relevance as they clearly have now. It would help others especially if the documentation is not being kept up to date for folks to find success with Capacitor.