Inbox View
CleverPush Inbox View
You can also implement CleverPush InboxView into your application. Inbox View will come up with the package of the all the notification you have recieved with the CleverPush. To use the InboxView you will need to use the sample code as described below.
Objective-C:
- Import "CleverPush/CPInboxView.h":
- Add the inbox view:
#import <CleverPush/CPInboxView.h>
CPInboxView *inboxView = [[CPInboxView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)
combine_with_api:YES
read_color:UIColor.whiteColor
unread_color:UIColor.lightGrayColor
notification_text_color:UIColor.blackColor
notification_text_font_family:@"AppleSDGothicNeo-Reguler"
notification_text_size:17
date_text_color:UIColor.blackColor
date_text_font_family:@"AppleSDGothicNeo-Reguler"
date_text_size:12
divider_colour:UIColor.blackColor];
[self.view addSubview:inboxView];
Swift:
- Import CleverPush
- Add the inbox view:
import CleverPush
let inboxView = CPInboxView(frame: CGRect(x: 0.0, y: 0, width: self.view.frame.size.width, height: self.view.frame.height ),
combine_with_api: true,
read_color: UIColor.white,
unread_color: UIColor.lightGray,
notification_text_color: UIColor.black,
notification_text_font_family: "AppleSDGothicNeo-Reguler",
notification_text_size: 17,
date_text_color: UIColor.black,
date_text_font_family: "AppleSDGothicNeo-Bold",
date_text_size: 12,
divider_colour: UIColor.black)
self.view.addSubview(inboxView!)
and you can get the call back events when you tapped on the any of the index from the list.
[inboxView notificationClickCallback:^(CPNotification *result) {
NSLog(@"%@", result);
}];
inboxView?.notificationClickCallback({ result in
print(result as Any)
})
Here is how the InboxView will looks.