PMInterstitialAdDelegate

Document created by david.simerly on Nov 8, 2017Last modified by david.simerly on Nov 9, 2017
Version 3Show Document
  • View in full screen mode
Conforms toNSObject
Declared inPMInterstitialAdDelegate.h

 

Overview

Protocol for interaction with the PMInterstitialAd.

The entire protocol is optional. Some messages override default behavior and some are required to get full support for MRAID 2 ad content (saving calendar entries or pictures).

All messages are guaranteed to occur on the main thread. If any any of the sent messages need responses from long running tasks, then execute them in a background thread to avoid UI delays for the user.

 

Ad Updates

 

Internal Browser Events

 

Rich Media Ad Events

 

Instance Methods

interstitialAd:didFailToReceiveAdWithError:

Sent on error during ad download or render.

- (void)interstitialAd:(PMInterstitialAd *)interstitialAd didFailToReceiveAdWithError:(NSError *)error

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

error

The error encountered while attempting to receive or render the ad.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAd:didProcessRichmediaRequest:

Sent after the SDK processes a richmedia event.

- (void)interstitialAd:(PMInterstitialAd *)interstitialAd didProcessRichmediaRequest:(NSURLRequest *)event

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

event

The NSURLRequest containing the event request.

Discussion

Applications can use this to react to various events if necessary but the SDK will have already processed them as necessary (expanded in result of an expand request).

Developers should not attempt to implement the specified event. The SDK will have already processed the event with the SDK implementation.

See the IAB MRAID 2 specification on the event types.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAd:shouldOpenURL:

Sent when selecting the ad will open a URL.

- (BOOL)interstitialAd:(PMInterstitialAd *)interstitialAd shouldOpenURL:(NSURL *)url

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

url

The URL to open.

Return Value

YES Allow the SDK to open the link with UIApplication’s openURL: or the internal browser.

NO Ignore the request

Discussion

Not implementing this method behaves as if YES was returned.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAd:shouldPlayVideo:

Sent when an ad attempts to play a video in an external player.

- (BOOL)interstitialAd:(PMInterstitialAd *)interstitialAd shouldPlayVideo:(NSString *)videoURL

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

videoURL

The URL string of the video to play.

Return Value

NO Do not open the URL and play the video.

YES Invoke UIApplication openURL: to play the video.

Discussion

The default is to open the URL and play the video.

Developers can use an application player and return NO to play the video directly.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAd:shouldSaveCalendarEvent:inEventStore:

Sent when a richmedia ad attempts to create a new calendar entry.

- (BOOL)interstitialAd:(PMInterstitialAd *)interstitialAd shouldSaveCalendarEvent:(EKEvent *)event inEventStore:(EKEventStore *)eventStore

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

event

The event to save.

eventStore

the store to save the event too.

Return Value

NO Do not attempt to add the calendar event.

YES Present the calendar event editor to the user to allow them to edit and save or cancel the event.

Discussion

Application developers can implement the dialog directly if desired by capturing the event and eventStore and returning nil. If not implemented the SDK will ignore the request.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAd:shouldSavePhotoToCameraRoll:

Sent when a richmedia ad attempts to save a picture to the camera roll.

- (BOOL)interstitialAd:(PMInterstitialAd *)interstitialAd shouldSavePhotoToCameraRoll:(UIImage *)image

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

image

The image to save.

Return Value

NO Do not save the image to the camera roll.

YES Attempt to save the image to the camera roll.

Discussion

Application developers should implement this by prompting the user to save the image and then saving it directly and returning NO from this delegate method. If not implemented the image will NOT be saved to the camera roll.

iOS 6 added privacy options for applications saving to the camera roll. The user will be prompted by iOS on the first attempt at accessing the camera roll. If the user selects No then pictures will not be saved to the camera roll even if this method is implemented and returns YES.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdCloseButtonPressed:

Sent when the user selects the ad's close button.

- (void)interstitialAdCloseButtonPressed:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Discussion

This only occurs for the close button enabled with setCloseButton:afterDelay: or in the case of a interstitial richmedia ad that closes itself. It will not be sent for richmedia close buttons that collapse expanded or resized ads.

The common use case is for interstitial ads so the developer will know when to call closeInterstitial.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdCustomCloseButton:

Implement to return a custom close button.

- (UIButton *)interstitialAdCustomCloseButton:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Return Value

UIButton instance.

Discussion

This button will be used for richmedia ads if the richmedia ad does not indicate it has its own custom close button. It is also used if showCloseButton:afterDelay: enables the close button.

Do not return the same UIButton instance to different interstitialAd instances.
Developers should take care of adding action handlers to the button as it will be reused and may persist beyond the handlers lifetime.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdDidRecieveAd:

Sent on successful ad download and render.

- (void)interstitialAdDidRecieveAd:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdInternalBrowserDidClose:

Sent after the internal browser closes.

- (void)interstitialAdInternalBrowserDidClose:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdInternalBrowserDidOpen:

Sent after the internal browser opens.

- (void)interstitialAdInternalBrowserDidOpen:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdInternalBrowserWillClose:

Sent before the internal browser closes.

- (void)interstitialAdInternalBrowserWillClose:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdInternalBrowserWillOpen:

Sent before the internal browser opens.

- (void)interstitialAdInternalBrowserWillOpen:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdPresentationController:

Allows the application to override the controller used to present modal controllers.

- (UIViewController *)interstitialAdPresentationController:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Return Value

UIViewController to use as the presenting view controller for any SDK modal view controller.

Discussion

The SDK by default will use the application’s rootViewController property to display modal dialogs. These include richmedia expand, internal browser and calendar event creation. To override using this controller implement this message and return the view controller that can be used to present modal view controllers.

Application’s SHOULD have a rootViewController set but the iOS SDK will allow an application to run without one. If the application can not set up the rootViewController as expected then this method MUST be implemented to return a view controller that can be used to present modal dialogs. Without one certain SDK features will not work including showInterstitial, richmedia expand and the internal browser.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdSupportsCalendar:

Allow developers to override calendar support.

- (BOOL)interstitialAdSupportsCalendar:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Return Value

NO Informs richmedia ads that calendar access is not supported.

YES Informs richmedia ads that calendar access is supported.

Discussion

Implement to indicate if calendar events can be created. The default behavior is to NOT allow calendar access.

See Also

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdSupportsPhone:

Allows developers to override phone support.

- (BOOL)interstitialAdSupportsPhone:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Return Value

NO Informs richmedia ads that phone calls is not supported.

YES Informs richmedia ads that phone calls is supported.

Discussion

If the device supports phone dialling this message will be sent to allow the developer to override support. The default behavior is to allow phone dialing.

This message is not sent of the device does not support phone dialing.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdSupportsSMS:

Allows developers to override SMS support.

- (BOOL)interstitialAdSupportsSMS:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Return Value

NO Informs richmedia ads that SMS is not supported.

YES Informs richmedia ads that SMS is supported.

Discussion

If the device supports SMS this message will be sent to allow the developer to override support. The default behavior is to allow SMS usage.

This message is not sent of the device does not support SMS.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdSupportsStorePicture:

Allows developers to override picture storing support.

- (BOOL)interstitialAdSupportsStorePicture:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Return Value

NO Informs richmedia ads that storing pictures is not supported.

YES Informs richmedia ads that storing pictures is supported.

Discussion

Implement to indicate if storing pictures is supported. The default behavior is to NOT allow storing of pictures.

Declared In

PMInterstitialAdDelegate.h

 

interstitialAdWillLeaveApplication:

Sent before the ad opens a URL that invokes another application (Safari or App Store for example).

- (void)interstitialAdWillLeaveApplication:(PMInterstitialAd *)interstitialAd

Parameters

interstitialAd

The PMInterstitialAd instance sending the message.

Declared In

PMInterstitialAdDelegate.h

Attachments

    Outcomes