Native iOS

Contents

  • 1 CocoaPods (preferred)

  • 2 Manual download

    • 2.1 POKKT Native iOS SDK v8.1.0 (GDPR Compliance)

    • 2.2 Pokkt iOS SDK Integration Guide v8.1.0

  • 3 SDK Configuration

  • 4 Full-Screen Ads

  • 5 Banner Ads

  • 6 Native Ads

  • 7 Display Native Ad

  • 8 Additional SDK Configuration

    • 8.1 GDPR

  • 9 Extra Parameter

  • 10 ThirdPartyUser Id

  • 11 User Detail

  • 12 Pokkt AdPlayer Configuration

  • 13 Migration Note Guide v 8.1.0

    • 13.1 Screen ID

    • 13.2 AdTypes

    • 13.3 Simpler APIs for full screen ads and banner ads.

    • 13.4 Ad Delegates are changed. SetDelegate API is removed.

    • 13.5 Native Ad

    • 13.6 isAdCached API is changed

    • 13.7 Destroy Banner API is changed

CocoaPods (preferred)

The simplest way to import the SDK into an iOS project is to use CocoaPodsarrow-up-right. Open your project's Podfile and add this line to your app's target:

Then from the command line run:

If you're new to CocoaPods, see their official documentationarrow-up-right for info on how to create and use Podfiles.

Manual download

Last Update: 29th October, 2021

Download Latest Version Here


Pokkt iOS SDK Integration Guide v8.1.0

  • Download the latest SDK. Here

  • Unzip the downloaded file and drag the PokktSDK.framework directory into Xcode under Framework.

  • Add the required compiler flags to 'Other Linker Flags' field in your project's Build Settings.

    • -ObjC

    • -lxml2

  • Make sure that these frameworks are included to respect the library dependencies:

    • Add Webkit.Framework.

    • ARKit.framework

Error creating thumbnail: File missing

SDK Configuration

1. Set Application Id and Security key in Pokkt SDK. You can get it from the Pokkt dashboard from your account. We generally assign unique application-id and security-key.

2. When your application is under development and if you want to see sdk logs and other informatory messages, you can enable it by setting setDebug to true . Make sure to disable debugging before release.

Full-Screen Ads

  1. Full-screen ads can be rewarded or non-rewarded and video or interstitial. You can either cache the ad in advance or directly call show for it.

  2. We suggest you cache the ad in advance so as to give seamless play behaviour, In other case it will stream the video which may lead to unnecessary buffering delays depending on the network connection.

  3. Screen-Id: ​ This one parameter is accepted by almost all API’s of Pokkt SDK. This controls the placement of ads and can be created on Pokkt Dashboard. We will be referencing the ​PokktAdsDemo ​ app provided with SDK during the course of explanation in this document. We suggest you go through the sample app for better understanding.

  4. To cache Full-screen ad call:

  5. To Show Video Ad:

    You can check if an ad is available, before making a show request.

  6. Ad actions are optional, but we suggest to implement them as it will help you to keep track of the status of your ad request.

  1. Load banner Ad call:

  2. Refresh banner: You can set banner refresh rate on pokkt dashboard. Refresh rate should be in range of 30 -100

  3. Destroy banner

  4. Ad actions are optional, but we suggest to implement them as it will help you to keep track of the status of your ad request.

Native Ads

  1. A native ad may be served in feed or in between the developer content inside the app. Normally, FullScreen ads are delivered on call to action by the user. Native ads eliminate this limitation and show ads without any user request.Native ads are also non intrusive as they will be automatically paused when the ad is out of the view by scrolling. The PokktNativeAdLayout will be part of developer application parent components which may be ListView, Layout in ScrollView or WebView. Load Native Ad:

  2. Ad actions are optional, but we suggest to implement them as it will help you to keep track of the status of your ad request.

Display Native Ad

When a native ad loads, your app will receive a native ad object via adReady delegate messages. Your app is then responsible for displaying the ad.

The first step is to create a UIView subclass that will display native ad assets. The class also provides IBOutlets used to register the view used for each individual asset. Below are the header file and nib file format:

Error creating thumbnail: File missing

Once the layout is complete and the outlets are linked, the last step is to add code to your app that displays an ad once it has loaded. Here's a method to display an ad in the view defined above:

Create a UIView class object in the class where you want to show native ads and pass that object properties to PokktNativeAdViewBinder class.

Developers will have to do cleanup of Native Ad on viewController deInit.

Additional SDK Configuration

As of May 25th, the General Data Protection Regulation (GDPR) will be enforced in the European Union.

Set GDPR consent in Pokkt SDK. This must be called before calling any ad related API. Developers/Publishers must get the consent from user. For more information on GDPR please refer https://www.eugdpr.org/arrow-up-right and https://www.eugdpr.org/gdpr-faqs.htmlarrow-up-right . This API can again be used by publishers to revoke the consent. If this API is not called or invalid data provided then SDK will access the users personal data for ad targeting

You can set extra parameters to POKKT SDK, to be passed back to your server via POKKT server callback. These Extra parameters will be in key-value pair.The key must be alphanumeric value. See the below example

ThirdPartyUser Id

If you are using server to server integration with Pokkt, you can also set Third Party UserId in PokktAds.

User Detail

For better targeting of ads you can also provide user details to our SDK using

Pokkt AdPlayer Configuration

Pokkt Ad player works the way App is configured at Pokkt dashboard, but we provide a way to override those settings using PokktAdPlayerViewConfig.

Application should prefer configuration provided through code by developer or what’s configured for the app in dashboard, can be controlled any time through the dashboard itself. If you want to make changes to this configuration after your app distribution, you can contact Pokkt Team to do the same for your app through admin console.

Various properties that can be managed through this are:

1. Default skip time Defines the time after which user can skip the Ad. Property name: DefaultSkipTime Values: Any Integer value. Default value is 10 seconds.

2. Should allow skip Defines if user is allowed to skip the Ad or not. Property name: ShouldAllowSkip Values: True = User can skip Ad. False = User can’t skip Ad.

3. Should allow mute Defines if user is allowed to mute the Video Ad or not. Property name: ShouldAllowMute Values: True = User can mute video Ad. False = User can’t mute video Ad.

4. Should confirm skip Defines if confirmation dialog is to be shown before skipping the Ad. Property name: ShouldConfirmSkip Values: True = Confirmation dialog will be shown before skipping the video. False = Confirmation dialog will not be shown before skipping the video.

5. Skip confirmation message Defines what confirmation message to be shown in skip dialog. Property name: SkipConfirmMessage Values: Any String message. Default value is “Skipping this video will earn you NO rewards. Are you sure?”.

6. Affirmative label for skip dialog Defines what should be the label for affirmative button in skip dialog. Property name: SkipConfirmYesLabel Values: Any String message. Default value is “Yes”.

7. Negative label for skip dialog Defines what should be the label for affirmative button in skip dialog. Property name: SkipConfirmNoLabel Values: Any String message. Default value is “No”.

8. Skip timer message Defines message to be shown before enabling skip button. Don’t forget to add placeholder “ ## ” in your custom message. This placeholder is replaced by property “Default skip time” assigned above. Property name: setSkipTimerMessage Values: Any String message. Default value is “You can skip video in ## seconds”

9. Incentive message Defines message to be shown during video progress, that after what time user will be incentivised. Property name: setIncentiveMessage Values: Any String message Default value is “more seconds only for your reward !”

10. AudioEnabled AudioEnabled set YES or NO to mute ad,if 'YES' ad will be mute. , default is NO. Property name: isAudioEnabled Values: True = If you want to mute Ad. False = If you don’t want to mute Ad.

11. Should collect feedback Defines message to be shown during video progress, that after what time user will be incentivised. Property name setShouldCollectFeedback Values: True = If you want to collect feedback from the user for the Ad. False = If you don’t want to collect feedback from the user for the Ad.

Migration Note Guide v 8.1.0

  • In case of any query regarding integration, refer “PokktSDK Integration Guide (iOS, v8.1.0)” for this version provided inside “PokktSDK_v8.1.0”.

Screen ID

ScreenId is accepted by almost all API’s of Pokkt SDK. This controls the placement of ads and can be created on Pokkt Dashboard. This replaced Screen Name used earlier.

AdTypes

Rewarded Video ads and Interstitial Ads are merged into full screen ad type and ad type can be changed in runtime by editing the screen id Ad type.

Simpler APIs for full screen ads and banner ads.

Ad Delegates are changed. SetDelegate API is removed.

Native Ad

Native Ads are introduced which replaces OutStream ads. Please refer to our documentation for details.

isAdCached API is changed

Last updated