Pokkt SDK for tvOS (v1.0) Integration Guide
Last Update: 17th October, 2016
Download Latest Version Here with PDF Documentation v1.0.
Pokkt tvOS SDK Version Notes
- Pokkt SDK for tvOS supports native video and interstitial ads which can be Rewarded or Non-Rewarded.
- Pokkt SDK for tvOS also supports Start and End Cards containing static creatives (jpeg/png/gif).
- Support for various Analytics (Google, Flurry, MixPanel, Fabrics).
- All event tracker support in tvOS.
- Skip Ad - clicking on menu button of AppleTV remove will allow to skip ad.
- Currently caching for video/images is not possible.
- Any web-enabled ad content is not supported, such as MRAID/VPAID/HTML ads etc.
- MOAT analytics is not compatible with tvOS.
- There is no close-button for video, start & end cards.
- No mute-button for video ads.
Pokkt SDK for tvOS Integration Guide
Please follow these steps as per your integration requirement
Extract the downloaded file. The contents of downloaded folder should look like following
tvOS_sdk_v5.0 | —— Pokkt_SDK_tvOS_Integration_Guide_5.0.pdf | —— PokktLib-universal.zip | —— SampleApp.zip | —— SwiftSample.zip
Extract the PokktLib-universal file. The contents of folder should look like following
PokktLib-universal | ——PokktSDK.framework | ——PokktSDK.bundle
- Go to your project’s settings’s “Build Phases -> Link Binary with Libraries”and add the PokktSDK.framework
- Make sure to add PokktSDK.bundlefile to application
Please add following exceptions in your application info.plist file(please edit as source for this.)
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>pokkt.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <false/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <true/> <key>NSThirdPartyExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSRequiresCertificateTransparency</key> <false/> </dict> <key>cloudfront.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <false/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <true/> <key>NSThirdPartyExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSRequiresCertificateTransparency</key> <false/> </dict> </dict> </dict>
Your Project needs to have following frameworks to use PokktSDK
- Foundation.framework - MediaPlayer.framework - SystemConfiguration.framework - UIKit.framework - AdSupport.framework - CoreGraphics.framework - AVFoundation.framework - libc++.tbd - CloudKit.Framework - AVKit.Framework
- Please make sure that your app project has -ObjC set as Other linker flagin Build Settings.
Need to enabled background fetch mode in Xcode for PokktSDK background fetch
Project Header -> Targets -> Capabilities -> Background Modes -> Enable Background fetch [application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
(Write this in DidFinishLaunchWithOption delegate method)
- You will have to call the notifyAppInstallmethod, When application launch first.
+ (void) notifyAppInstall
- For all invocation of Pokkt SDK developer will make use of methods available in PokktManager class.This class only have static methods.
- You will have to implement the PokktInitDelegateprotocol in your class to know PokktSDK initialisation has been succeed or failed.
- You will have to implement the AdDelegateprotocol in your class to listen for all ad (Video, Interstitial) related events.
- Before Calling PokktManager init method it’s recommended to set PokktInitDelegateto know PokktInit Succeeded or failed.
- Before calling any other methods from the PokktManagerplease make sure that you have called the initPokktalready.
- For initPokkt method call PokktConfiginstance. PokktConfigis plain NSObject object which will hold all the values required by the SDK which you need to assign.
- In PokktConfig you can assign applicationId andsecurityKey which are must for all type of integrations.
- If you are doing server to server integration with pokkt you can also mention thirdPartyUserIdin PokktConfig.
- Apart from above mentioned parameters you can assign additional ones based on your integration type.(please refer to Ad sections below.)
- While in development please call [PokktManager setDebug:YES]; to see pokkt debug logs and toast messages. please make sure to change this to [PokktManager setDebug:NO]; for production build.
- To export log you need to enable iCloud from capabilities in general setting.
- Please call [PokktManager.trackIAP: InAppPurchaseDetails]to send any inapp purchase information to Pokkt.
- For almost all ad related methods call, AdConfig instance is required. AdConfigis NSObject object which will hold all the values required by the SDK which you need to assign for getting an Ad.
- In AdConfig you can assign screenName, isRewarded, shouldAllowSkip, DefaultSkipTime, SkipConfirmMessage, ShouldAllowMute, ShouldSkipConfirm, SkipConfirmYesLabel, SkipConfirmNoLabel, SkipTimerMessage and IncentiveMessage . These values can be used to configure the behaviour of ad.
- In AdConfig you can assign screenName, isRewarded, shouldAllowSkip, defaultSkipTime, skipConfirmMessage, shouldAllowMute, shouldSkipConfirm, skipConfirmYesLabel, skipConfirmNoLabel, skipTimerMessageand incentiveMessage. These values can be used to configure the behaviour of ad.
- For getting specific type of ad set adFormat in adConfig. AdFormat is a type for ad such as 0:video, 1: banner, 3: interstitial , default is 0
- If you want to enable/disable the skip button on video screen please set shouldAllowSkipas true/false.The default value for shouldAllowSkipis true.
- If you have enabled skipped button by setting shouldAllowSkipas true then you can control after how many seconds the skip button will be visible in video by setting defaultSkipTimeto appropriate value.Since most videos will be 30 sec or less please set defaultSkipTimeas 10 or less.You can also give your own skip message by setting skipConfirmMessageon AdConfig
- screenNamehas default value as defaultand can be used by you to give different screen name for different places in your app where you are showing ads. You will control ad targeting based on these screen names which should match exactly with screen names defined in dashboard. ScreenName can not contain white spaces and only special characters allowed are hyphen and underscore.
- You can choose to show ad with or without incentive to user by setting isRewardedas true or false. Video gratification will only happen for incentivised playback.
- You can configure the ad skip dialog yes/no labels by setting skipConfirmYesLabeland skipConfirmNoLabel.
- You can configure the ad incentive message by setting incentiveMessage. !
- You can configure the ad skip timer message by setting skipTimerMessage. The message must contain a ##placeholder to show skip time value, which will keep changing as per the time.
Ad (Video and Interstitial)
- Before calling cache and show method you need to create AdDelegate implementation class as mentioned in step 3in implementation steps. After that set adDelegate by calling [PokktManager setAdDelegate:];
- You can call [PokktManager checkAdAvailability: (AdConfig *)adConfig to check if the campaign are available for a particular adConfig before you try to show ad.
- You can call [PokktManager showAd:(AdConfig *)adConfig viewController: (UIViewController *)viewController]; to show ad.
- You will get different callbacks as given in AdDelegateimplementation class for ad display.
- Please reward user only from the onAdGratifiedmethod in AdDelegate implementation class.
- PokktConfigalso has provision for developers to provide extra user data available with them to pokkt. We currently support following data points: name, age, sex, mobileNo, emailAddress, location, birthday, maritalStatus, facebookId, twitterHandle, education, nationality, employmentand maturityRating.
- PokktConfig also has provision for developer to provide multiple analytics trackers available with them to pokkt. Those are Google,Flurry and MixPanel. Which need the trackerID. Currently supported : googleTrackerID, flurryTrackerID and mixPanelTrackerID.
- PokktConfig providing the eventype for the type of analytic used in application side . Which is eventType(Event types are provided in PokktConfig class only)
- Please do not copy the code points from this pdf as it may introduce unwanted characters and space in your code.instead please refer to sample app source code in pokkt bundle.
- Please also refer to sample app source code for better understanding of implementation.