In-App Notification

Configure target rules for in-app notifications.

In-app Messaging includes both Banners and Surveys. They are displayed on the basis of user activities on android.

Every event occurs in the context of an Activity. Every activity can be associated with some contextual data, which can be used as targeting rules for In-app Messaging.

Use the below show() Method for every activity. show() Method should be used only once as per the activity.
You can pass an optional callback function as the last parameter if you want to get responses from banners and survey clicks.

Notifyvisitors.show((JSONObject)tokens, (JSONObject)customObjects, (String)fragmentName, callback );

Notifyvisitors.show(null,null,null, function(callback){
 alert("show response : " + callback); 
});  
//fragmentName:- In react you can pass this parameters as null
Notifyvisitors.shared.show(null, null, null);            
//fragmentName:- In flutter you can pass this parameters as null

//Example
Notifyvisitors.shared.show((JSON Object)tokens, (JSON Object)rules, fragmentName, (var response) {
     // response
 });
NotifyVisitors.show((JSONObject)tokens, (JSONObject)customObjects, (String)fragmentName, (optional)callback);

//Example
NotifyVisitors.show(null,null,null, function(callback){
 alert("show response : " + callback); 
 });               
//fragmentName:- In Ionic or Cordova you can pass this parameters as null
const inAppData = {tokens:{"name":"neeraj"}, customRules:{"banerrType":"dashborad"}};
NotifyVisitors.show(inAppData);

//Example
 const inAppData = {
      tokens: { name: "neeraj" },
      customRules: { page: "dashborad" },
 };
 NotifyVisitors.show(inAppData);

DYNAMIC TOKENS (JSON Object)

Dynamic tokens are used to show personalized content in Notification messages in real-time.

var customRules = { "category" : "flowers" };
var dynamicTokens = { "name" : "ravi", "age" : 49 };

Notifyvisitors.show(dynamicTokens, customRules, null);
var customRules = { "category" : "flowers" };
var dynamicTokens = { "name" : "ravi", "age" : 49 };

Notifyvisitors.shared.show(dynamicTokens, customRules, null);
var customRules = { "category" : "flowers" };
var dynamicTokens = { "name" : "ravi", "age" : 49 };

NotifyVisitors.show(dynamicTokens, customRules, null);
const inAppData = {tokens:{"name":"neeraj"}, customRules:{"banerrType":"dashborad"}};
NotifyVisitors.show(inAppData);

//Example
 const inAppData = {
      tokens: { name: "neeraj" },
      customRules: { page: "dashborad" },
 };
 NotifyVisitors.show(inAppData);

CUSTOM RULES (JSON Object)

This data can be used in configuring targeting rules for the Notifications.

var customRules = { "category" : "flowers" };
var dynamicTokens = { "name" : "ravi", "age" : 49 };

notifyvisitors.show(dynamicTokens, customRules, null);
var customRules = { "category" : "flowers" };
var dynamicTokens = { "name" : "ravi", "age" : 49 };

Notifyvisitors.shared.show(dynamicTokens, customRules, null);
var customRules = { "category" : "flowers" };
var dynamicTokens = { "name" : "ravi", "age" : 49 };

NotifyVisitors.show(dynamicTokens, customRules, null);
 const inAppData = {
      tokens: { name: "neeraj" },
      customRules: { page: "dashborad" },
 };
 NotifyVisitors.show(inAppData);

FRAGMENT NAME (string)

If you have multiple fragment tabs in your activity, you can use the show method for each fragment and pass the fragment name as the third argument.