Added in plugin version 8.2.0
Engage active app users with contextual messages.
Check out the (code of the) Vue demo!
To add this feature to your project, either:
- Remove
firebase.nativescript.json
from the root of the project and runnpm i
, or - Edit that file and add
"in_app_messaging": true
.
In both cases, remove the /platforms
folder afterwards so the required native library will be added upon the next build.
There's nothing you have to do code-wise if you only want to display messages. If you want to capture a 'button clicked' event however, read on.
import { inappmessaging } from "nativescript-plugin-firebase/inappmessaging";
inappmessaging.onMessageClicked(message => {
console.log("Clicked a button for Campaign: " + message.campaignName);
});
You can also get notified if a message is being shown to a user:
import { inappmessaging } from "nativescript-plugin-firebase/inappmessaging";
inappmessaging.onMessageImpression(message => {
console.log("A message belonging to this campaign is being shown: " + message.campaignName);
});