Notification Center
Open App Inbox
You can show a list of push notifications received in an In-app Notification Center. Expiry of the notifications can be set from the panel.
NotifyVisitors.shared.showNotifications((JSON Object)appInboxInfo, (int)dismiss);
*If you want to use a customized notification center. Pass a json object appInboxInfo as the first parameter. Otherwise pass null for standard notification center.
*The Key’s value should be static and values will be dynamic.
*You can create upto three labels. Label names exactly same as you passed in notifyvisitors panel.
var appInboxInfo = {
"label_one" : "tab1Label",
"name_one" : "name_a" ,
"label_two" : "tab2Label" ,
"name_two" : "name_b",
"label_three" : "tab3Label",
"name_three" : "name_c",
"selectedTabTextColor" : "#FF3D00",
"unselectedTabTextColor" : "#FF6D00",
"selectedTabBgColor":"#E1BEE7",
"unselectedTabBgColor_ios" : "#00796B",
"selectedTabIndex_ios" : "0",
"tabTextFontName_ios" : "xxx",
"tabTextFontSize_ios" : "13"
};
dismiss:- You can dismiss the notification-center page after clicking the notification.
pass 0 :- notification-center page will not be destroyed from memory.
pass 1 :- notification-center page destroyed from memory.
//Example:
Notifyvisitors.shared.showNotifications(appInboxInfo, 0);
Notification Count
This function provides the unread count(s) of push notifications. This functionality can be used to show the user number of unread push notification count on the bell icon.
Pass a json object tabCountInfo as the first parameter. Otherwise pass null for standard notification center.
The Key’s value should be static and values will be dynamic
var tabCountInfo = {
"label_one" : "tab1Label",
"name_one" : "name_a" ,
"label_two" : "tab2Label" ,
"name_two" : "name_b",
"label_three" : "tab3Label",
"name_three" : "name_c"
};
Notifyvisitors.shared.getNotificationCenterCount(tabCountInfo, callback);
//Example
Notifyvisitors.shared.getNotificationCenterCount(info).then((response){
// do your task
});
Notification Center Data
This function provides notification center data as JSON in callback. This functionality can be used if a client wants to create their own custom notification center ui.
Notifyvisitors.shared.getNotificationCenterData(callback);
//Example
Notifyvisitors.shared.getNotificationData()
.then((value) {
// do your task
});
Stop Notification
If a client wants to stop displaying inapp notifications (banners & surveys) then they can call this function in their app.
Notifyvisitors.stopNotification();
Updated 3 months ago