Custom URL Scheme
Introduction
Custom URL schemes provide a way to reference content inside your app. Users can open a custom URL in the browser or tap on a link. Other apps can also launch your app with specific context data; for example, a photo library app might display a specified image.
Configuration
Android
This assumes you have already generated the android folder. If not, see the setup link here.
Step 1: Open the AndroidManifest.xml file, in the android/app/src/main folder.
Step 2: Add an intent filter for incoming links. Inside the
activitytag, add the following lines of code:<intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <!-- Accepts URIs that begin with "com.casewhere.mobile://” --> <data android:scheme="com.casewhere.mobile"/> </intent-filter>
IOS
This assumes you have already generated the ios folder. If not, see the link in ionic or capacitor for setting up and running.
- Step 1: Open the project in Xcode, then select it.
- Step 2: Select the Info tab.
- Step 3: Go to the URL Types and click on ‘+’.
- Step 4: Enter
com.casewhere.mobilein Identifier and URL Schemes.