When a user clicks on an ad, companion banner ad, or a related button, your application is responsible for responding. The PSDK provides you with information about the destination URL for the click.
On desktop platforms, the video ad playback area is typically used for invoking click-through URLs upon user clicks.
On mobile devices, the video ad playback area is used for other functions, such as hiding and showing controls, pausing playback, expanding to full screen, and so on. Therefore, on mobile devices, a separate view, such as a sponsor button, is usually presented to the user as a means to launch the click-through URL.
// Listening for click notification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMediaPlayerAdClick:)
name:PTMediaPlayerAdClickNotification object:self.player];
- (void) onMediaPlayerAdClick:(NSNotification *) notification {
NSString *url = [notification.userInfo objectForKey:PTMediaPlayerAdClickURLKey];
if (url != nil) {
[self openBrowser:[NSURL URLWithString:url]];
}
}