{"_id":"59ccf56233dd99001a597c4a","category":{"_id":"59ccf56133dd99001a597c3a","version":"59ccf56133dd99001a597c39","project":"56e6e8b9cec7530e006a7133","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-14T16:37:13.082Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"parentDoc":null,"user":"56e6d120f3b12a3200df21ba","project":"56e6e8b9cec7530e006a7133","version":{"_id":"59ccf56133dd99001a597c39","project":"56e6e8b9cec7530e006a7133","__v":1,"createdAt":"2017-09-28T13:13:05.846Z","releaseDate":"2017-09-28T13:13:05.846Z","categories":["59ccf56133dd99001a597c3a","59ccf56133dd99001a597c3b","59ccf56133dd99001a597c3c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.3.10","version":"1.3.10"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-14T16:37:13.125Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Add the SDK\"\n}\n[/block]\n## Cocoa Pods\n1. To integrate _BuzzSDK_ for iOS into your Xcode project using CocoaPods, specify it in your `Podfile`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"source 'https://github.com/CocoaPods/Specs.git'\\nplatform :ios, '9.0'\\nuse_frameworks!\\n\\ntarget 'YOUR_APPLICATION_TARGET_NAME_HERE' do\\n  pod 'BuzzSDK', '1.3.10'\\nend\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n2. Then, run the following command: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ pod install\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n## Manually\n1. Drag **BuzzSDK.framework** to the **Embedded Binaries** section in the _General_ tap of your project's main target. Check _Copy items if needed_ and choose to _Create groups_.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/EB6xkdrESQWeuGovpuig_DragToEmbedd.jpg\",\n        \"DragToEmbedd.jpg\",\n        \"1102\",\n        \"795\",\n        \"#30538b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n2. Add a new Run Script Phase in your target’s Build Phases.\n**IMPORTANT**: Make sure this Run Script Phase is below the Embed Frameworks build phase.\nYou can drag and drop build phases to rearrange them.\nPaste the following line in this Run Script Phase's script text field: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bash \\\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/BuzzSDK.framework/ios-strip-frameworks.sh\\\" BuzzSDK\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2cd3d8c-Screen_Shot_2017-08-08_at_16.29.26.png\",\n        \"Screen Shot 2017-08-08 at 16.29.26.png\",\n        776,\n        841,\n        \"#d4d9de\"\n      ]\n    }\n  ]\n}\n[/block]\n3. (Ignore if your project is a Swift only project) - Set the **Always Embed Swift Standard Libraries** setting in your targets _Build Settings_ to **YES**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/c399d14-AlwaysEmbedSwiftLibraries.png\",\n        \"AlwaysEmbedSwiftLibraries.png\",\n        913,\n        161,\n        \"#dad9d6\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Quick Launch\"\n}\n[/block]\n1. Open your _AppDelegate.m_ file and import the _BuzzSDK_. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#import <BuzzSDK/BuzzSDK.h>\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"import BuzzSDK\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n2. Copy the lines below and paste them into your AppDelegate’s `application:didFinishLaunchingWithOptions:launchOptions` method \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[BuzzSDK startWithAPIKey: :::at:::\\\"YOUR_API_KEY\\\" secretKey: @\\\"YOUR_SECRET_KEY\\\"];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"BuzzSDK.startWithAPIKey(\\\"YOUR_API_KEY\\\", secretKey: \\\"YOUR_SECRET_KEY\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n3. Call [`presentDeck`](doc:presentdeck) class method to display the SDK UI when appropriate. Typically on your `applicationDidBecomeActive` app delegate method call.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"- (void)applicationDidBecomeActive:(UIApplication *)application {\\n    [BuzzSDK presentDeck];\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func applicationDidBecomeActive(_ application: UIApplication) {\\n\\tBuzzSDK.presentDeck()\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Try it out\"\n}\n[/block]\nYou can implement the SDK and try it out with our generic test credentials. Just copy the snippet below as your initialisation call and you could see it on action.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[BuzzSDK startWithAPIKey: @\\\"e78grdmnqainn9pnz6fllabyzjxptpdq\\\" secretKey: @\\\"0pwb6ep3em0t3dsamr0wqn1lin3h9tir\\\"];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"BuzzSDK.startWithAPIKey(\\\"e78grdmnqainn9pnz6fllabyzjxptpdq\\\", secretKey: \\\"0pwb6ep3em0t3dsamr0wqn1lin3h9tir\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nPlease contact us to get the BuzzSDK files if you are not using CocoaPods\n[block:api-header]\n{\n  \"title\": \"Setup with Delegate\"\n}\n[/block]\nIn most cases you would like to receive notifications from _BuzzSDK_ for specific important events. \nFor this reasons, the _BuzzSDK_ class can have a delegate that must adopt the [_BuzzSDKDelegate_](doc:buzzsdkdelegate) protocol.\n\nTo setup a delegate call the [`setDelegate:`](doc:setdelegate)  class method of the _BuzzSDK_ class after your call to start. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[BuzzSDK startWithAPIKey: @\\\"YOUR_API_KEY\\\" secretKey: @\\\"YOUR_SECRET_KEY\\\" andSDKOptions:nil];\\n[BuzzSDK setDelegate:self];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"BuzzSDK.startWithAPIKey(\\\"YOUR_API_KEY\\\", secretKey: \\\"YOUR_SECRET_KEY\\\", andSDKOptions: nil)\\nBuzzSDK.setDelegate(self)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Setup with Groups\"\n}\n[/block]\n_Groups_ allow you to split users into several groups with different sets of online configuration settings. Groups and online configuration settings are managed via _BuzzSDK_ dashboard (please contact us for access to the dashboard).\n\nWhen using groups you must initialise the _BuzzSDK_ by calling the  [`startWithAPIKey:secretKey:groupId:andSDKOptions:`](doc:startwithapikeysecretkeygroupidandsdkoptions) class method. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[BuzzSDK startWithAPIKey: @\\\"YOUR_API_KEY\\\" secretKey: @\\\"YOUR_SECRET_KEY\\\" groupId:0 andSDKOptions:nil];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"BuzzSDK.startWithAPIKey(\\\"YOUR_API_KEY\\\", secretKey: \\\"YOUR_SECRET_KEY\\\", groupId: 0, andSDKOptions: nil)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Setup with `Remove Ads Alert` option\"\n}\n[/block]\nWhen your account configuration provide Ads, you can setup the _BuzzSDK_ to present a custom alert that allow the user to opt for an Ad free version of the app via payment or subscriptions.\n\nTo present such an alert the host app will need to provide the text string for the alert message in the `kBUZZSDKOptionRemoveAdsAlertTextKey` option when starting the _BuzzSDK_. If this string is not provided the alert will never be presented. \nOptions are provided as a dictionary when starting the _BuzzSDK_ using the [`startWithAPIKey:secretKey:andSDKOptions:`](doc:startwithapikeysecretkeyandsdkoptions) or [`startWithAPIKey:secretKey:groupId:andSDKOptions:`](doc:startwithapikeysecretkeygroupidandsdkoptions) class methods.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"@interface AppDelegate () <BuzzSDKDelegate>\\n\\n  ...\\n\\nNSDictionary *sdkOptions = @{\\n  // Remove Ads Alerte Text\\n  kBUZZSDKOptionRemoveAdsAlertTextKey : @\\\"Would you like to stop seeing ads on your app?\\\\nTap OK for premium!\\\",\\n};\\n\\n[BuzzSDK startWithAPIKey: @\\\"YOUR_API_KEY\\\" secretKey: @\\\"YOUR_SECRET_KEY\\\" andSDKOptions:sdkOptions];\\n[BuzzSDK setDelegate:self];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"class AppDelegate: UIResponder, UIApplicationDelegate, BuzzSDKDelegate\\n\\n...\\n\\nlet sdkOptions = [\\n  // Remove Ads Alerte Text\\n  kBUZZSDKOptionRemoveAdsAlertTextKey : \\\"Would you like to stop seeing ads on your app?\\\\nTap OK for premium!\\\",\\n]\\n\\nBuzzSDK.startWithAPIKey(\\\"YOUR_API_KEY\\\", secretKey: \\\"YOUR_SECRET_KEY\\\", andSDKOptions: sdkOptions)\\nBuzzSDK.setDelegate(self)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nIf the  _Remove Ads Alert_ is presented, the _BuzzSDK_ will call your implementation of [`BuzzSDKDelegate`](doc:buzzsdkdelegate) method [`buzzSDKRemoveAdsButtonTapped`](doc:buzzsdkremoveadsbuttontapped) when the user taps on the OK button of the alert view. It is your responsibility to act upon this call and direct the user to the appropriate section on your app where he/she can for instance subscribe to an Ad free version of your app. \nWhen user taps on the _Remove Ads Alert_ OK button any video playing on top of the UI will be sent to Picture In Picture (PIP) to allow the user to interact with your app. If only a video Ad card is left which has already finished playing, then the _BuzzSDK_ UI will be removed completely after calling the delegate.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"- (void)buzzSDKRemoveAdsButtonTapped {\\n\\t// Direct your UI for instance to Subscribe section,\\n  NSLog(@\\\"Remove Ads button Tapped\\\"); \\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"func buzzSDKRemoveAdsButtonTapped() {\\n\\t// Direct your UI for instance to Subscribe section\\n\\tprint(\\\"Remove Ads button Tapped\\\")\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Advance Configuration Options\"\n}\n[/block]\n_BuzzSDK_ allows you also to define the following options. Just add the `key : value` pairs to the options dictionary when starting the _BuzzSDK_ using the [`startWithAPIKey:secretKey:andSDKOptions:`](doc:startwithapikeysecretkeyandsdkoptions) or [`startWithAPIKey:secretKey:groupId:andSDKOptions:`](doc:startwithapikeysecretkeygroupidandsdkoptions) class methods.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Values\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`kBUZZSDKOptionLogLevel`\",\n    \"0-1\": \"Enum\\nObjC: Wrapped in NSNumber \\nSwift: Int (Enum raw value)\\n- BUZZSDKLogLevelNone\\n- BUZZSDKLogLevelError\\n- BUZZSDKLogLevelWarning\\n- BUZZSDKLogLevelInfo\\n- BUZZSDKLogLevelDebug\",\n    \"0-2\": \"Define the log level to be used by the SDK in your App.\",\n    \"1-0\": \"`kBUZZSDKOptionMaxTimeToLiveWhileAppInactiveKey`\",\n    \"1-1\": \"Integer (seconds)\\nObjC: Wrapped in NSNumber\\nSwift: Int\",\n    \"1-2\": \"Indicates maximum amount of time which SDK Deck is allowed to stay present if the app has been made inactive (in seconds).\\nDefault value is 600 seconds (10 minutes)\",\n    \"2-0\": \"`kBUZZSDKOptionNoAdsKey`\",\n    \"2-1\": \"Boolean\\nObjC: Wrapped in NSNumber\\nSwift: Bool\",\n    \"2-2\": \"This option will indicates that the SDK should ignore any Ads provided by the backend config for the SDK session. \\nThis will be used when the host app still wants to present the SDK for content but no Ads (i.e. if the user is for example a subscribed user)\\nDefault value is `false`\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\nWhen presenting video content in addition to video ads, the style of the _title_ and _kicker_ of the content elements (also referred as Cards) can be configured as options in the same way by passing the `key : value` pairs below:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`kBUZZSDKOptionCardStyleKickerFontNameKey`\",\n    \"0-1\": \"ObjC: NSString \\nSwift: String\",\n    \"0-2\": \"The PostScript name of the Font for the kicker on content cards. See note below regarding custom fonts.\\nDefault value is `HelveticaNeue-CondensedBold`\",\n    \"1-0\": \"`kBUZZSDKOptionCardStyleKickerFontSizeKey`\",\n    \"1-1\": \"float (point size)\\nObjC: Wrapped in NSNumber\\nSwift: Float\",\n    \"1-2\": \"The size in points to apply to the kicker on content cards.\\nDefault value is `17.0`\",\n    \"2-0\": \"`kBUZZSDKOptionCardStyleKickerTextColorKey`\",\n    \"2-1\": \"UIColor\",\n    \"2-2\": \"The UIColor instance to use for the kicker text color on content cards.\\nDefault value is `[UIColor whiteColor]`\",\n    \"3-0\": \"`kBUZZSDKOptionCardStyleKickerBackgroundColorKey`\",\n    \"3-1\": \"UIColor\",\n    \"3-2\": \"The UIColor instance to use for the kicker background color on content cards.\\nDefault value is `[UIColor whiteColor]`\",\n    \"4-0\": \"`kBUZZSDKOptionCardStyleTitleFontNameKey`\",\n    \"5-0\": \"`kBUZZSDKOptionCardStyleTitleFontSizeKey`\",\n    \"6-0\": \"`kBUZZSDKOptionCardStyleTitleTextColorKey`\",\n    \"7-0\": \"`kBUZZSDKOptionCardStyleTitleBackgroundColorKey`\",\n    \"4-1\": \"ObjC: NSString \\nSwift: String\",\n    \"5-1\": \"float (point size)\\nObjC: Wrapped in NSNumber\\nSwift: Float\",\n    \"6-1\": \"UIColor\",\n    \"7-1\": \"UIColor\",\n    \"4-2\": \"The PostScript name of the Font for the title on content cards. See note below regarding custom fonts.\\nDefault value is `HelveticaNeue-CondensedBold`\",\n    \"5-2\": \"The size in points to apply to the kicker on content cards.\\nDefault value is `24.0`\",\n    \"6-2\": \"The UIColor instance to use for the kicker background color on content cards.\\nDefault value is `[UIColor blackColor]`\",\n    \"7-2\": \"The UIColor instance to use for the kicker background color on content cards.\\nDefault value is `[UIColor whiteColor]`\"\n  },\n  \"cols\": 3,\n  \"rows\": 8\n}\n[/block]\n**Note about Fonts**: For custom fonts, which are not a part of the iOS SDK, you should include them into your app's bundle, and add corresponding key to the plist file. If a provided font is not found the default one will be used.","excerpt":"This page will help you get started with BUZZ SDK. You'll be up and running in a jiffy!","slug":"getting-started","type":"basic","title":"Getting Started"}

Getting Started

This page will help you get started with BUZZ SDK. You'll be up and running in a jiffy!

[block:api-header] { "type": "basic", "title": "Add the SDK" } [/block] ## Cocoa Pods 1. To integrate _BuzzSDK_ for iOS into your Xcode project using CocoaPods, specify it in your `Podfile`: [block:code] { "codes": [ { "code": "source 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget 'YOUR_APPLICATION_TARGET_NAME_HERE' do\n pod 'BuzzSDK', '1.3.10'\nend", "language": "ruby" } ] } [/block] 2. Then, run the following command: [block:code] { "codes": [ { "code": "$ pod install", "language": "shell" } ] } [/block] ## Manually 1. Drag **BuzzSDK.framework** to the **Embedded Binaries** section in the _General_ tap of your project's main target. Check _Copy items if needed_ and choose to _Create groups_. [block:image] { "images": [ { "image": [ "https://files.readme.io/EB6xkdrESQWeuGovpuig_DragToEmbedd.jpg", "DragToEmbedd.jpg", "1102", "795", "#30538b", "" ] } ] } [/block] 2. Add a new Run Script Phase in your target’s Build Phases. **IMPORTANT**: Make sure this Run Script Phase is below the Embed Frameworks build phase. You can drag and drop build phases to rearrange them. Paste the following line in this Run Script Phase's script text field: [block:code] { "codes": [ { "code": "bash \"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/BuzzSDK.framework/ios-strip-frameworks.sh\" BuzzSDK", "language": "shell" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/2cd3d8c-Screen_Shot_2017-08-08_at_16.29.26.png", "Screen Shot 2017-08-08 at 16.29.26.png", 776, 841, "#d4d9de" ] } ] } [/block] 3. (Ignore if your project is a Swift only project) - Set the **Always Embed Swift Standard Libraries** setting in your targets _Build Settings_ to **YES** [block:image] { "images": [ { "image": [ "https://files.readme.io/c399d14-AlwaysEmbedSwiftLibraries.png", "AlwaysEmbedSwiftLibraries.png", 913, 161, "#dad9d6" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Quick Launch" } [/block] 1. Open your _AppDelegate.m_ file and import the _BuzzSDK_. [block:code] { "codes": [ { "code": "#import <BuzzSDK/BuzzSDK.h>", "language": "objectivec" }, { "code": "import BuzzSDK", "language": "swift" } ] } [/block] 2. Copy the lines below and paste them into your AppDelegate’s `application:didFinishLaunchingWithOptions:launchOptions` method [block:code] { "codes": [ { "code": "[BuzzSDK startWithAPIKey: @\"YOUR_API_KEY\" secretKey: @\"YOUR_SECRET_KEY\"];", "language": "objectivec" }, { "code": "BuzzSDK.startWithAPIKey(\"YOUR_API_KEY\", secretKey: \"YOUR_SECRET_KEY\")", "language": "swift" } ] } [/block] 3. Call [`presentDeck`](doc:presentdeck) class method to display the SDK UI when appropriate. Typically on your `applicationDidBecomeActive` app delegate method call. [block:code] { "codes": [ { "code": "- (void)applicationDidBecomeActive:(UIApplication *)application {\n [BuzzSDK presentDeck];\n}", "language": "objectivec" }, { "code": "func applicationDidBecomeActive(_ application: UIApplication) {\n\tBuzzSDK.presentDeck()\n}", "language": "swift" } ] } [/block] [block:api-header] { "type": "basic", "title": "Try it out" } [/block] You can implement the SDK and try it out with our generic test credentials. Just copy the snippet below as your initialisation call and you could see it on action. [block:code] { "codes": [ { "code": "[BuzzSDK startWithAPIKey: @\"e78grdmnqainn9pnz6fllabyzjxptpdq\" secretKey: @\"0pwb6ep3em0t3dsamr0wqn1lin3h9tir\"];", "language": "objectivec" }, { "code": "BuzzSDK.startWithAPIKey(\"e78grdmnqainn9pnz6fllabyzjxptpdq\", secretKey: \"0pwb6ep3em0t3dsamr0wqn1lin3h9tir\")", "language": "swift" } ] } [/block] Please contact us to get the BuzzSDK files if you are not using CocoaPods [block:api-header] { "title": "Setup with Delegate" } [/block] In most cases you would like to receive notifications from _BuzzSDK_ for specific important events. For this reasons, the _BuzzSDK_ class can have a delegate that must adopt the [_BuzzSDKDelegate_](doc:buzzsdkdelegate) protocol. To setup a delegate call the [`setDelegate:`](doc:setdelegate) class method of the _BuzzSDK_ class after your call to start. For example: [block:code] { "codes": [ { "code": "[BuzzSDK startWithAPIKey: @\"YOUR_API_KEY\" secretKey: @\"YOUR_SECRET_KEY\" andSDKOptions:nil];\n[BuzzSDK setDelegate:self];", "language": "objectivec" }, { "code": "BuzzSDK.startWithAPIKey(\"YOUR_API_KEY\", secretKey: \"YOUR_SECRET_KEY\", andSDKOptions: nil)\nBuzzSDK.setDelegate(self)", "language": "swift" } ] } [/block] [block:api-header] { "title": "Setup with Groups" } [/block] _Groups_ allow you to split users into several groups with different sets of online configuration settings. Groups and online configuration settings are managed via _BuzzSDK_ dashboard (please contact us for access to the dashboard). When using groups you must initialise the _BuzzSDK_ by calling the [`startWithAPIKey:secretKey:groupId:andSDKOptions:`](doc:startwithapikeysecretkeygroupidandsdkoptions) class method. For example: [block:code] { "codes": [ { "code": "[BuzzSDK startWithAPIKey: @\"YOUR_API_KEY\" secretKey: @\"YOUR_SECRET_KEY\" groupId:0 andSDKOptions:nil];", "language": "objectivec" }, { "code": "BuzzSDK.startWithAPIKey(\"YOUR_API_KEY\", secretKey: \"YOUR_SECRET_KEY\", groupId: 0, andSDKOptions: nil)", "language": "swift" } ] } [/block] [block:api-header] { "title": "Setup with `Remove Ads Alert` option" } [/block] When your account configuration provide Ads, you can setup the _BuzzSDK_ to present a custom alert that allow the user to opt for an Ad free version of the app via payment or subscriptions. To present such an alert the host app will need to provide the text string for the alert message in the `kBUZZSDKOptionRemoveAdsAlertTextKey` option when starting the _BuzzSDK_. If this string is not provided the alert will never be presented. Options are provided as a dictionary when starting the _BuzzSDK_ using the [`startWithAPIKey:secretKey:andSDKOptions:`](doc:startwithapikeysecretkeyandsdkoptions) or [`startWithAPIKey:secretKey:groupId:andSDKOptions:`](doc:startwithapikeysecretkeygroupidandsdkoptions) class methods. [block:code] { "codes": [ { "code": "@interface AppDelegate () <BuzzSDKDelegate>\n\n ...\n\nNSDictionary *sdkOptions = @{\n // Remove Ads Alerte Text\n kBUZZSDKOptionRemoveAdsAlertTextKey : @\"Would you like to stop seeing ads on your app?\\nTap OK for premium!\",\n};\n\n[BuzzSDK startWithAPIKey: @\"YOUR_API_KEY\" secretKey: @\"YOUR_SECRET_KEY\" andSDKOptions:sdkOptions];\n[BuzzSDK setDelegate:self];", "language": "objectivec" }, { "code": "class AppDelegate: UIResponder, UIApplicationDelegate, BuzzSDKDelegate\n\n...\n\nlet sdkOptions = [\n // Remove Ads Alerte Text\n kBUZZSDKOptionRemoveAdsAlertTextKey : \"Would you like to stop seeing ads on your app?\\nTap OK for premium!\",\n]\n\nBuzzSDK.startWithAPIKey(\"YOUR_API_KEY\", secretKey: \"YOUR_SECRET_KEY\", andSDKOptions: sdkOptions)\nBuzzSDK.setDelegate(self)", "language": "swift" } ] } [/block] If the _Remove Ads Alert_ is presented, the _BuzzSDK_ will call your implementation of [`BuzzSDKDelegate`](doc:buzzsdkdelegate) method [`buzzSDKRemoveAdsButtonTapped`](doc:buzzsdkremoveadsbuttontapped) when the user taps on the OK button of the alert view. It is your responsibility to act upon this call and direct the user to the appropriate section on your app where he/she can for instance subscribe to an Ad free version of your app. When user taps on the _Remove Ads Alert_ OK button any video playing on top of the UI will be sent to Picture In Picture (PIP) to allow the user to interact with your app. If only a video Ad card is left which has already finished playing, then the _BuzzSDK_ UI will be removed completely after calling the delegate. [block:code] { "codes": [ { "code": "- (void)buzzSDKRemoveAdsButtonTapped {\n\t// Direct your UI for instance to Subscribe section,\n NSLog(@\"Remove Ads button Tapped\"); \n}", "language": "objectivec" }, { "code": "func buzzSDKRemoveAdsButtonTapped() {\n\t// Direct your UI for instance to Subscribe section\n\tprint(\"Remove Ads button Tapped\")\n}", "language": "swift" } ] } [/block] [block:api-header] { "title": "Advance Configuration Options" } [/block] _BuzzSDK_ allows you also to define the following options. Just add the `key : value` pairs to the options dictionary when starting the _BuzzSDK_ using the [`startWithAPIKey:secretKey:andSDKOptions:`](doc:startwithapikeysecretkeyandsdkoptions) or [`startWithAPIKey:secretKey:groupId:andSDKOptions:`](doc:startwithapikeysecretkeygroupidandsdkoptions) class methods. [block:parameters] { "data": { "h-0": "Key", "h-1": "Values", "h-2": "Description", "0-0": "`kBUZZSDKOptionLogLevel`", "0-1": "Enum\nObjC: Wrapped in NSNumber \nSwift: Int (Enum raw value)\n- BUZZSDKLogLevelNone\n- BUZZSDKLogLevelError\n- BUZZSDKLogLevelWarning\n- BUZZSDKLogLevelInfo\n- BUZZSDKLogLevelDebug", "0-2": "Define the log level to be used by the SDK in your App.", "1-0": "`kBUZZSDKOptionMaxTimeToLiveWhileAppInactiveKey`", "1-1": "Integer (seconds)\nObjC: Wrapped in NSNumber\nSwift: Int", "1-2": "Indicates maximum amount of time which SDK Deck is allowed to stay present if the app has been made inactive (in seconds).\nDefault value is 600 seconds (10 minutes)", "2-0": "`kBUZZSDKOptionNoAdsKey`", "2-1": "Boolean\nObjC: Wrapped in NSNumber\nSwift: Bool", "2-2": "This option will indicates that the SDK should ignore any Ads provided by the backend config for the SDK session. \nThis will be used when the host app still wants to present the SDK for content but no Ads (i.e. if the user is for example a subscribed user)\nDefault value is `false`" }, "cols": 3, "rows": 3 } [/block] When presenting video content in addition to video ads, the style of the _title_ and _kicker_ of the content elements (also referred as Cards) can be configured as options in the same way by passing the `key : value` pairs below: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "h-2": "Description", "0-0": "`kBUZZSDKOptionCardStyleKickerFontNameKey`", "0-1": "ObjC: NSString \nSwift: String", "0-2": "The PostScript name of the Font for the kicker on content cards. See note below regarding custom fonts.\nDefault value is `HelveticaNeue-CondensedBold`", "1-0": "`kBUZZSDKOptionCardStyleKickerFontSizeKey`", "1-1": "float (point size)\nObjC: Wrapped in NSNumber\nSwift: Float", "1-2": "The size in points to apply to the kicker on content cards.\nDefault value is `17.0`", "2-0": "`kBUZZSDKOptionCardStyleKickerTextColorKey`", "2-1": "UIColor", "2-2": "The UIColor instance to use for the kicker text color on content cards.\nDefault value is `[UIColor whiteColor]`", "3-0": "`kBUZZSDKOptionCardStyleKickerBackgroundColorKey`", "3-1": "UIColor", "3-2": "The UIColor instance to use for the kicker background color on content cards.\nDefault value is `[UIColor whiteColor]`", "4-0": "`kBUZZSDKOptionCardStyleTitleFontNameKey`", "5-0": "`kBUZZSDKOptionCardStyleTitleFontSizeKey`", "6-0": "`kBUZZSDKOptionCardStyleTitleTextColorKey`", "7-0": "`kBUZZSDKOptionCardStyleTitleBackgroundColorKey`", "4-1": "ObjC: NSString \nSwift: String", "5-1": "float (point size)\nObjC: Wrapped in NSNumber\nSwift: Float", "6-1": "UIColor", "7-1": "UIColor", "4-2": "The PostScript name of the Font for the title on content cards. See note below regarding custom fonts.\nDefault value is `HelveticaNeue-CondensedBold`", "5-2": "The size in points to apply to the kicker on content cards.\nDefault value is `24.0`", "6-2": "The UIColor instance to use for the kicker background color on content cards.\nDefault value is `[UIColor blackColor]`", "7-2": "The UIColor instance to use for the kicker background color on content cards.\nDefault value is `[UIColor whiteColor]`" }, "cols": 3, "rows": 8 } [/block] **Note about Fonts**: For custom fonts, which are not a part of the iOS SDK, you should include them into your app's bundle, and add corresponding key to the plist file. If a provided font is not found the default one will be used.