Lauch FB messenger in Ionic

Hi all,

I want to launch Facebook Messenger when user click to a button.
I use these code but It said “com.facebook.orca is NOT available”

  (yes) => {
    console.log(app + ' is available')
    const browser = this.iab.create(app);;
  (no) => console.log(app + ' is NOT available')

How can I do it ? Please help me.


Check what the error from the promise is

	() => {
		console.log(app, "is available");
		const browser = this.iab.create(app);;
	err => {
		console.log(app, "is NOT available");

Thank @mich356c

It has no error from the promise. When I clicked to the button, nothing happen.
. this.iab.create(app); // app : fb-messenger://

Nothing happens? Doesn’t it say either of “is available” or “is not available”? Can you provide some more code of the button and what it’s calling

I think the problem is the function appAvailability, so I remove the code appAvailability.

const browser = this.iab.create(app);;

It open a browser with the url is http://'fb-messenger://

Shouldn’t that say com.facebook.orca? Maybe the issue is that the wrong app id is entered somewhere

I changed the app link to com.facebook.orca, It open the fb messenger now. but It also crash my app :frowning:

Well, progress :joy: Still no errors in the console? Does return a Promise which could potentially have an uncaught error?

The error in Android studio :

java.lang.NullPointerException: Attempt to invoke virtual method ‘void’ on a null object reference
at org.apache.cordova.inappbrowser.InAppBrowser$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)

It seems that calling show is only needed if you create the instance as hidden, which you did not, so I believe you can scrap the .show()

Did you mean remove the code; . I 've removed it. It not crash, but it restart my app and not open fb messenger :smile:

Have a look at this Ionic opening external app :upside_down:

I read the topic you sent before. It does not work.

Thank for your help.