5
votes

Recently I show a new option in the firebase console called "In-App Messaging" so I wondered is there any option in ionic plugin to implement the same so I go through the each and every firebase plugin like https://ionicframework.com/docs/native/firebase-messaging/ and https://ionicframework.com/docs/native/fcm/

But can't find any option related to this so I tried with installing the fcm plugin just need to check in case its automatically managed by firebase libraries. But when I create an In-App campaign and checked anything happens or not but nothing is happening.

so do you guys have any idea how its work ? I understand its still in beta mode so it will take time to reflects in ionic plugin.

2

2 Answers

0
votes

Cordova plugin for Firebase In-App Messaging

https://www.npmjs.com/package/cordova-plugin-firebase-inappmessaging

Sorry, I know I am late, but I think it's helpful to others

-1
votes

We're using Ionic FCM and it works well. There are a number of errors that can show up when you build but assuming you didn't get those or you would have posted them. So if you're able to build to successfully build to a device without errors then:

If you're sending messages to a topic then make sure to subscribe on the client:

this.fcm.subscribeToTopic(NameOfYourTopic);

Or use the client's unique firebase token which you can get on the client with:

const token = await this.fcm.getToken()

But that's just two of the more obvious things to check. There are a lot of ways the whole thing can fail and sending messages from the firebase console doesn't give you the feedback you need to find the errors. In setting up our system, running this from a shell script and a local terminal was the best way quickly test, fix, test again.

curl -X POST -H "Authorization: key=<your key from the firebase console> -H "Content-Type: application/json" -d '{
  "notification": {
    "title": "Yo friend says",
    "body": "Pay attention to me",
  },
  "to": <unique device token>
}' "https://fcm.googleapis.com/fcm/send"