Search code examples
httpwebsocketnativescriptnativescript-vue

How can I create links of my native script app just like a web page? And listen to them?


We can perform a specific task when a URL is called in the web apps. Suppose we can send an email when a POST request just hits a .php file. Exactly the same thing I want to do in nativescript. So the questions are:

  • How can I create links of my apps?
  • How can I call them?
  • How can it perform an action when a specific URL is called from my app?

Actually I'm building a chat application which will use http calls rather than socket io or firebase value change listeners, etc.

Thanks in advance!


Solution

  • I think you are looking for deep linking. Use nativescript-urlhandler plugin, setup a URL scheme for your app. Then all you need is just listen to the event and perform navigation for that URL.

    Apple started supporting Universal Links only from iOS 9. You will have to follow some additional steps mentioned in the Apple Docs, basically verify you own the domain.