Requesting Rewarded video Woobi Vidget

Woobi edited this page Aug 21, 2018 · 7 revisions

Woobi Vidget

A single incentivized video ad.

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.start(withAppId: <your token>)

The listener helps you get notifications by the methods below.
Delegate methods to implementation:
(void) onError:(NSError*) error;
(void) onShowVidget;
(void) onCloseVidget;
(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 Vidget API

There are 2 ways to integrate the Woobi Vidget:

  • 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) getAndShowVidgetWithViewController:(UIViewController*)parentViewController andAppId:(NSString*)appId andClientId:(NSString*)clientId andCustomParams:(NSDictionary*)customParams andAnimationType:(WoobiAnimationType)animationType andOrientationMode:(VideoOrientation)orientationMode;

For get (option 2) please call:
+(void) getVidgetWithViewController:(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" vidget function to show the cached ad later as mentioned above.

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

Example for option 1:

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

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

Example for option 2:

Get Method:
[Woobi getVidgetWithViewController: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 showVidget];
This method will play the ad on your screen.

To present the "Vidget" 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 could be:

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

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

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.