Decode and get data from Branch link programmatically in Ionic

1k views Asked by At

In my Ionic 5 app, I am trying to provide functionality for users to copy a Branch.io link from anywhere and paste/type it in the App. I want to use the link and trigger the same action when it is clicked to get the data and perform the action in the App.

I am using Ionic BranchIo plugin.

I am not getting any Branch method to do this action and decode the link. Method branch.initSession() will only work if the link is clicked.

Any ideas on how can I achieve this?

1

There are 1 answers

0
Kartik Shandilya On

Since you are trying to read the link data associated to the deep link you can use the Branch Deep Linking API for this use case.

Example Request Payload -

curl -XGET 'https://api2.branch.io/v1/url?url=https://example.app.link/WgiqvsepqF&branch_key=key_live_xxxxxxxx'