How to use Deep Links and Universal Links in Oracle Apex Cordova Projects


Basically, The goal of them is to open the application via URL. Deep links are using for Android and, Universal Links are for IOS.
Before using them, let's see why I needed them.
My use-case was if the user wanted to buy the product on our app, the app was opening mollie.com webpage on the browser. After payment is done, mollie.com is redirecting back to the website to show the invoice. But now the app is on the web browser, instead of Cordova Android/IOS app. Ways to turn back our app were inconvenient. Such as user was re-opening the app again. 
So, A something basic movement must open the Cordova project to be user-friendly like clicking a button on the invoice webpage.
Let's see it how I did step by step
  1. Create a button called by 'Go to app' and redirect a unique URL as a Universal/Deep Link, e.g simplyvisio://
    1.  
  2. To create a deep link in the android,
    1. Open the Cordova project in the Android Studio
    2. Add an android:scheme to AndroidManifest.xml according to the below code.
    3. <application........>
          <activity..........>
               <inter-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 = "simplyvisio" />
               </inter-filter ........>
           </activity..........>
      </application>
  3. To create a Universal Link in the IOS.
    1. Open the Cordova project on the Xcode
    2. Click the project main file, and go to the Info page
    3. Add a new row Url Types in Custom IOS Target Properties
      1. it will have item 0, extend it, you will see Url identifier, put a unique identifier such as com.visio.simply
      2. and a new row under the item 0 call URL Schemes it will have item 0, give a value for it.
    4. Another way of it, Go to Info page again, and on the bottom, there is URL Types, click + , if there is no object.
      1. give unique identifier and URL Schemes

After all, if you put URL starts with "simplyvisio://" on the address bar of a web browser in Android/IOS devices that installed the app, the device will open your app. So, our "Go back to App" button will work! 

Yorumlar

  1. That's what I was looking for. Thanks for this nice informations. Waiting for your future works. Keep up the good work.

    YanıtlaSil

Yorum Gönder