Stories
CleverPush Story Widget
You can also implement CleverPush Stories into your application. For this, please set up a Story Widget in your CleverPush account. You can access stories via generated Widget Id and by following usage guide
Here is how the Stories will looks like:
import CleverPush
let storyView = CPStoryView(frame: CGRect(x: 0.0, y: 83.0, width: self.view.frame.size.width, height: 125.0 ),
backgroundColor: UIColor.green,
textColor: UIColor.black,
fontFamily: "AppleSDGothicNeo-Bold",
borderColor: UIColor.red,
titleVisibility:true,
titleTextSize:10,
storyIconHeight:75,
storyIconWidth:105,
widgetId: "STORY_WIDGET_ID")!
self.view.addSubview(storyView)
#import <CleverPush/CPStoryView.h>
CPStoryView *storyView = [[CPStoryView alloc]
initWithFrame:CGRectMake(0.0, 83.0, self.view.frame.size.width, 125.0)
backgroundColor:[UIColor greenColor]
textColor:[UIColor blackColor]
fontFamily:@"AppleSDGothicNeo-Bold"
borderColor:[UIColor redColor]
titleVisibility:true
titleTextSize:10
storyIconHeight:75
storyIconWidth:105
widgetId:@"STORY_WIDGET_ID"];
[self.view addSubview:storyView];
Handle opened URLs in stories:
storyView.setOpenedCallback:^(NSURL *url) {
NSLog(@"URL OPENED");
}
storyView.setOpenedCallback { url in
print("URL OPENED")
}