In-app Notifications
Pass tokens and customer rules to show in-app notifcations.
Every event occurs in the context of a View Controller. Every View Controller can be associated with some contextual data, which can be used as targeting rules for In-App Notifications.
Use the below show() Method for every View Controller. Show() Method can be used only once as per View Controller.
notifyvisitors.show(UserToken, customRule: CustomRule)
[notifyvisitors Show:UserToken CustomRule:CustomRule];
Default values are passed as nil.
-
Dynamic Tokens (NSMutableDictionary)
Dynamic tokens are used to show personalized content in Notification messages real time. -
Custom Rules (NSMutableDictionary)
This data can be used in configuring targeting rules for the Notifications.
[notifyvisitors Show:nil CustomRule:nil];
// OR
NSMutableDictionary *DynamicTokens = [[NSMutableDictionary alloc] init];
[DynamicTokens setObject:@"Jhon" forKey:@"firstname"];
[DynamicTokens setObject:@"[email protected]" forKey:@"email"];
NSMutableDictionary *CustomRule = [[NSMutableDictionary alloc] init];
[CustomRule setObject:@"fation" forKey:@"category"];
[CustomRule setObject:@"2000" forKey:@"price"];
[notifyvisitors Show:DynamicTokens CustomRule:CustomRule ];
- If you are using UI Scroll View. Use the following method in your “ScrollViewDidScroll” delegate method.
func scrollViewDidScroll(_ scrollView: UIScrollView) {
notifyvisitors.scrollViewDidScroll(scrollView)
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
[notifyvisitors scrollViewDidScroll:scrollView];
}
- If you need to dismiss all inApp notifications currently viewing on screen, you can call DismissAllNotifyvisitorsInAppNotifications method like this:
notifyvisitors.dismissAllNotifyvisitorsInAppNotifications()
[notifyvisitors DismissAllNotifyvisitorsInAppNotifications];
Updated almost 2 years ago