EddyVerbruggen / Custom-URL-scheme

:link: Launch your Cordova/PhoneGap app by a Custom URL scheme like mycoolapp://
1.03k stars 365 forks source link

Not working with InAppBrowser to launch app from another app #330

Open rolinger opened 3 years ago

rolinger commented 3 years ago

I did the standard install for primary app and then on secondary app I created a link to call/open the primary app using InAppBrowser - but when I click on the link in secondary app nothing happens. I then tested InAppBrowser on secondary app to open a general website (google) and it worked just fine.

On primary app: ionic cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=primaryapp

In primary app config.xml: `

On secondary app template: <button ng-click="openApp();">launch app</button>

Secondary app controller:

  $scope.openApp = function() {
    cordova.InAppBrowser.open('primaryapp://', '_system') ;
    console.log("launching app") ;
  }

In secondary app, nothing happens, but console message does get displayed. Is there a call back I can set that might tell show me an error? Or what am I missing from my configs?

rolinger commented 3 years ago

I then tried another method using https://github.com/lampaa/com.lampa.startapp - an app I know that works launching other apps like Uber, FB etc. But that plugin is also not finding primaryapp and is defaulting to taking the user to the app stores to get the app - but the app is already installed.

rolinger commented 3 years ago

Using the com.lampa.startapp plugin, I am getting the following error on my URL_SCHEME:

class android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=com.primaryapp:// }

I am only testing on Android so far.