Skip to content

Requesting Non Rewarded Video

Woobi edited this page Aug 21, 2018 · 6 revisions

Woobi Vidget- Non Rewarded Video

In WoobiVidget, It is possible to request non rewarded video ads

General

Objective C:
#import <Woobi/Woobi.h>
[Woobi setEventListener:self]; (optional) get callbacks by the listener, in h. file declare the interface as delegate to WoobiEventListener
[Woobi startWithAppId:<your token>];

Swift:
#import <Woobi/Woobi.h> in your bridging header file. (Automatically imports for you)
Woobi.setEventListener(self) (optional) get callbacks by the listener, declare the class as delegate to WoobiEventListener
[Woobi startWithAppId:<your token>];

The listener helps you get notifications by the methods below.
Delegate methods to implementation:
(void) onError:(NSError*) error;
(void) onShowPopup;
(void) onClosePopup;
(void) vastReady;

You can update the GDPR and Consent from the user by calling the method:
[Woobi setGDPRState:<true/false> andConsent:<consent string>];
The default value of GDPR is false and Consent ian s empty string.

Woobi Video Interstitial API

There are 2 ways to integrate the Woobi Video Interstitial:

  • getAndShow: This option lets you call "getAndShow" to show the ad and show it immediately without caching.
  • get: Precache - When you call the "get" method, you receive an ad which is saved in the cache until you play it by calling the "show" method. The ad is saved for up to 90 minutes or until the user closes the app. If the user closes the app, you will need to call the "get" method again.

For getAndShow (option 1) please call:
+ (void) getAndShowWoobiNonIncentWithViewController:(UIViewController*)parentViewController andAppId:(NSString*)appId andClientId:(NSString*)clientId andCustomParams:(NSDictionary*)customParams andAnimationType:(WoobiAnimationType)animationType andOrientationMode:(VideoOrientation)orientationMode;

For get (option 2) please call:
+(void) getWoobiNonIncentWithViewController:(UIViewController*)parentViewController andAppId:(NSString*)appId andClientId:(NSString*)clientId andCustomParams:(NSDictionary*)customParams andAnimationType:(WoobiAnimationType)animationType andOrientationMode:(VideoOrientation)orientationMode;

You can use the "get" method in order to know if there is an ad available and call the "show" function to show the cached ad later as mentioned above.

For show (option 2) please call:
+ (void) showNonIncent;

Example for option 1:

Objective C:
[Woobi getAndShowWoobiNonIncentWithViewController:self andAppId:@"your app id" andClientId:@"your client id" andCustomParams:nil andAnimationType:_WOOBI_DEFAULT andOrientationMode:DEFAULT];

Swift:
Woobi.getAndShowWoobiNonIncentWithViewController(with: viewController, andAppId: "your app id", andClientId: "your client id", andCustomParams: nil, andAnimationType: .WOOBI_DEFAULT, andOrientationMode: .DEFAULT)

Example for option 2:

Get Method:
[Woobi getWoobiNonIncentWithViewController:self andAppId:@"your app id" andClientId:@"your client id" andCustomParams:nil andAnimationType:_WOOBI_DEFAULT andOrientationMode:LANDSCAPE];
When the ad is ready, you get a callback to vastReady method, so you need to make sure that you listen to the listener.

Show Method:
[Woobi showNonIncent];
This method will play the ad on your screen.

To present the Interstitial Video "Non-Incent" ad, the following API should be activated:

  • appId (required): The application id as provided in Woobi management system.
  • clientId: the unique user id. not required, we will generate if it's empty or nil.
  • customParams: Parameters as NSDictionary that Woobi passes to the RTB server. This can be nil if no parameters added.

AnimationType - choose animation type, possible values:

  • _WOOBI_DEFAULT (_WOOBI_SCALE)
  • _WOOBI_NONE
  • _WOOBI_ROTATE
  • _WOOBI_SLIDE
  • _WOOBI_SCALE

OrientationMode - possible values:

  • DEFAULT (LANDSCAPE)
  • PORTRAIT
  • LANDSCAPE
  • PORTRAIT_FORCE
  • LANDSCAPE_FORCE

*If there are no videos available, the function will not open a popup.