{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"HyBid iOS SDK - HyBid Configuration","type":"basic","slug":"hybid-ios-sdk-hybid-configuration-beta","excerpt":"","body":"[block:api-header]\n{\n  \"title\": \"Migration from the PubNativeLite SDK to the HyBid SDK\"\n}\n[/block]\nAs you might have noticed, we changed our product name from **PubNativeLite** to **HyBid**. What that means is that if your project uses the old PubNativeLite SDK, we encourage you to check out the **Migration to HyBid.framework** document [here](http://developers.pubnative.net/v3.0/docs/migration-to-hybidframework) for a smooth migration.\n[block:api-header]\n{\n  \"title\": \"Install HyBid SDK\"\n}\n[/block]\nThere are 2 ways that you can install HyBid into your application;\n\n* [Download](https://github.com/pubnative/pubnative-hybid-ios-sdk/releases) `HyBid.xcframework` and simply drag and drop the `HyBid.xcframework` file into your project's target.\n* **IMPORTANT NOTE:** Make sure it is set for **Embed & Sign** in General, under \"Frameworks, Libraries and Embedded Content\"\n\nor\n\n* If you're using [CocoaPods](https://cocoapods.org), you can add the following line to your `Podfile`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pod 'HyBid', '2.3.1'\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n**NOTE:** _If you already have the previous versions of HyBid iOS SDK in your project and you are updating to the `HyBid.xcframework`, you need to remove the **Run Script** under **Build Phases**. You don't need that anymore._\n[block:api-header]\n{\n  \"title\": \"Integrate The Adapters\"\n}\n[/block]\nTo use the Adapters in your project, simply import **`PubnativeLite/PubnativeLiteDemo/Adapters`** file and all of its contents to your project.\n[block:api-header]\n{\n  \"title\": \"Swift Integration\"\n}\n[/block]\nTo use the Adapters in your Swift project, ensure that you've imported **`PubnativeLite/PubnativeLiteDemo/Adapters/HyBid-Bridging-Header.h`** to your project and the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header\n[block:api-header]\n{\n  \"title\": \"Initialise SDK\"\n}\n[/block]\nAdd the **`HyBid.framework`** to your code.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import HyBid\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#import <HyBid/HyBid.h>\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nIn order to initialize a request, you must call **`init()`** before requesting for ads.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HyBid.initWithAppToken(\\\"<YOUR_APP_TOKEN_HERE>\\\") { (success) in\\n            if (success) {\\n                print(\\\"HyBid Successfully Initialized\\\")\\n            }\\n        }\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" [HyBid initWithAppToken::::at:::\\\"<YOUR_APP_TOKEN_HERE>\\\" completion:^(BOOL success) {\\n        if (success) {\\n            NSLog(@\\\"HyBid initialisation completed\\\");\\n        }\\n    }];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Advanced Configurations\"\n}\n[/block]\nThere are certain parameters that should be configured in the SDK before doing any type of interaction with it. Ensure to configure these parameters only 1 per session.\n\n**If your app is COPPA compliant:** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HyBid.setCoppa(Bool)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[HyBid setCoppa:BOOL];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n**Test Mode**\n\nIn development, you should set Test Mode as **`true`** for our SDK and disable it in the release. It allows not to track impressions and tracks on the server side of development application:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HyBid.setTestMode(Bool)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[HyBid setTestMode:BOOL];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n**Targeting**\n\nIf you want to improve targeting, first configure the **`HyBidTargetingModel`** object that you want to pass on and then invoke the following method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var targeting = HyBidTargetingModel()\\ntargeting.age = <AGE>\\ntargeting.interests = <ARRAY_OF_THE_INTERESTS>\\ntargeting.gender = \\\"<GENDER>\\\"     // \\\"f\\\" for female, \\\"m\\\" for male\\nHyBid.setTargeting(targeting)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HyBidTargetingModel *targeting = [[HyBidTargetingModel alloc] init];\\ntargeting.age = <AGE>;\\ntargeting.interests = <ARRAY_OF_THE_INTERESTS>;\\ntargeting.gender = \\\"<GENDER>\\\";     // \\\"f\\\" for female, \\\"m\\\" for male\\n[HyBid setTargeting:targeting];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Logging\"\n}\n[/block]\nYou can control the level of log that you want to see in your console. As default **`HyBidLogger`** is set to **`HyBidLogLevelDebug`**. There are 5 HyBidLogLevels;\n- HyBidLogLevelNone\n- HyBidLogLevelError\n- HyBidLogLevelWarning\n- HyBidLogLevelInfo\n- HyBidLogLevelDebug\n\nIf you want to set a different HyBidLogLevel in your app, the best place is to do it in the HyBid initialization part.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HyBid.initWithAppToken(\\\"<YOUR_APP_TOKEN_HERE>\\\") { (success) in\\n            if (success) {\\n                HyBidLogger.setLogLevel(HyBidLogLevelDebug)\\n                print(\\\"HyBid Successfully Initialized\\\")\\n            }\\n        }\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" [HyBid initWithAppToken:@\\\"<YOUR_APP_TOKEN_HERE>\\\" completion:^(BOOL success) {\\n        if (success) {\\n            [HyBidLogger setLogLevel:HyBidLogLevelDebug];\\n            NSLog(@\\\"HyBid initialisation completed\\\");\\n        }\\n    }];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"SKAdNetwork\"\n}\n[/block]\n**`SKAdNetwork`** is an attribution solution introduced by Apple. It validates advertiser-driven app installations without disclosing user-level data. With the iOS 14 update, the utilization of **`SKAdNetwork`** framework will become more important since IDFA (Apple’s Identifier for Advertiser) is going to be opted-out by default.\n\nThe 'opted-out by default' setup was originally planned to happen with the release of iOS 14, but has been delayed to early next year. To prepare the change in time, we suggest you to already start adding support for **`SKAdNetwork`**.\n\n1. Add each **`SKAdNetwork`** ID with the key **`SKAdNetworkIdentifier`** as a list to your App's **`Info.plist`** under the key **`SKAdNetworkItems`**. \n\nPubNative's SKAdNetwork ID is: **`TL55SBB4FM.skadnetwork`**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\t<key>SKAdNetworkItems</key>\\n\\t<array>\\n\\t\\t<dict>\\n\\t\\t\\t<key>SKAdNetworkIdentifier</key>\\n\\t\\t\\t<string>TL55SBB4FM.skadnetwork</string>\\n\\t\\t</dict>\\n\\t</array>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n2. Set your AppStore ID\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" HyBid.setAppStoreAppID(\\\"NUMERIC_APPSTORE_ID_HERE\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[HyBid setAppStoreAppID:@\\\"NUMERIC_APPSTORE_ID_HERE\\\"];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n***[Return to the HyBid](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk)***\n***[Return to the MoPub Adapter](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-adapter-for-mopub)***\n***[Return to the MoPub Pre-Bid](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-pre-bid-for-mopub)***\n***[Return to the DFP Pre-Bid](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-pre-bid-for-dfp)***","updates":[],"order":9,"isReference":false,"hidden":true,"sync_unique":"","link_url":"","link_external":false,"_id":"5fe0de287b26110011573018","createdAt":"2020-12-21T17:40:56.637Z","user":"59ef127e3a256500102bb232","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"[PUBLISHER] HyBid SDK","slug":"hybid-android-sdk","order":3,"from_sync":false,"reference":false,"_id":"5b1a43bd678eab0003aa54a4","project":"574ff4bd3fa1870e00889ba6","version":"574ff4bd3fa1870e00889ba9","createdAt":"2018-06-08T08:52:13.470Z","__v":1},"version":{"version":"3.0","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["574ff4bd3fa1870e00889baa","577278ecdceb570e003a9001","577279865617b117009e643f","577279985617b117009e6440","577279bc8c48e00e00503504","5774fe18605b770e0037be8a","577ce3ad87acf617003c4187","577f8476a77c700e006a6c52","57b486ae0d2b640e00e9d3f5","57b722133d3e620e004ec74b","57bd95f00fe3a00e003e2cc5","57c8349359cd4b0e00b888ef","57c8349b5754fa1700b12242","57cedb0bad483e0e00890239","57cedbe807d7ea0e00e438cc","57d82967156ef72b007ffcd8","58ee353ad1ee2f0f0034a13d","596623221738df00298622a5","59a51730192dba000fc9ca38","59a8129f1e7b26000fa0fb1a","5a0322bf044b6f001c236e36","5a79897c5b6e430030746df6","5a79898c2b2d5f0012cbab63","5ab3b5e3d2d1e2006252a8f2","5b1a43bd678eab0003aa54a4","5b6d95e29d346300038baff3","5c77d3a1e0794000451bced2","5e902519bb65b200466e7957","5f228f5bd6a1cc0024afda30"],"_id":"574ff4bd3fa1870e00889ba9","createdAt":"2016-06-02T08:56:29.492Z","project":"574ff4bd3fa1870e00889ba6","releaseDate":"2016-06-02T08:56:29.492Z","__v":29},"project":"574ff4bd3fa1870e00889ba6","__v":0,"parentDoc":null}

HyBid iOS SDK - HyBid Configuration


[block:api-header] { "title": "Migration from the PubNativeLite SDK to the HyBid SDK" } [/block] As you might have noticed, we changed our product name from **PubNativeLite** to **HyBid**. What that means is that if your project uses the old PubNativeLite SDK, we encourage you to check out the **Migration to HyBid.framework** document [here](http://developers.pubnative.net/v3.0/docs/migration-to-hybidframework) for a smooth migration. [block:api-header] { "title": "Install HyBid SDK" } [/block] There are 2 ways that you can install HyBid into your application; * [Download](https://github.com/pubnative/pubnative-hybid-ios-sdk/releases) `HyBid.xcframework` and simply drag and drop the `HyBid.xcframework` file into your project's target. * **IMPORTANT NOTE:** Make sure it is set for **Embed & Sign** in General, under "Frameworks, Libraries and Embedded Content" or * If you're using [CocoaPods](https://cocoapods.org), you can add the following line to your `Podfile`. [block:code] { "codes": [ { "code": "pod 'HyBid', '2.3.1'", "language": "ruby" } ] } [/block] **NOTE:** _If you already have the previous versions of HyBid iOS SDK in your project and you are updating to the `HyBid.xcframework`, you need to remove the **Run Script** under **Build Phases**. You don't need that anymore._ [block:api-header] { "title": "Integrate The Adapters" } [/block] To use the Adapters in your project, simply import **`PubnativeLite/PubnativeLiteDemo/Adapters`** file and all of its contents to your project. [block:api-header] { "title": "Swift Integration" } [/block] To use the Adapters in your Swift project, ensure that you've imported **`PubnativeLite/PubnativeLiteDemo/Adapters/HyBid-Bridging-Header.h`** to your project and the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header [block:api-header] { "title": "Initialise SDK" } [/block] Add the **`HyBid.framework`** to your code. [block:code] { "codes": [ { "code": "import HyBid", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "#import <HyBid/HyBid.h>", "language": "objectivec" } ] } [/block] In order to initialize a request, you must call **`init()`** before requesting for ads. [block:code] { "codes": [ { "code": "HyBid.initWithAppToken(\"<YOUR_APP_TOKEN_HERE>\") { (success) in\n if (success) {\n print(\"HyBid Successfully Initialized\")\n }\n }", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": " [HyBid initWithAppToken:@\"<YOUR_APP_TOKEN_HERE>\" completion:^(BOOL success) {\n if (success) {\n NSLog(@\"HyBid initialisation completed\");\n }\n }];", "language": "objectivec" } ] } [/block] [block:api-header] { "title": "Advanced Configurations" } [/block] There are certain parameters that should be configured in the SDK before doing any type of interaction with it. Ensure to configure these parameters only 1 per session. **If your app is COPPA compliant:** [block:code] { "codes": [ { "code": "HyBid.setCoppa(Bool)", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "[HyBid setCoppa:BOOL];", "language": "objectivec" } ] } [/block] **Test Mode** In development, you should set Test Mode as **`true`** for our SDK and disable it in the release. It allows not to track impressions and tracks on the server side of development application: [block:code] { "codes": [ { "code": "HyBid.setTestMode(Bool)", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "[HyBid setTestMode:BOOL];", "language": "objectivec" } ] } [/block] **Targeting** If you want to improve targeting, first configure the **`HyBidTargetingModel`** object that you want to pass on and then invoke the following method: [block:code] { "codes": [ { "code": "var targeting = HyBidTargetingModel()\ntargeting.age = <AGE>\ntargeting.interests = <ARRAY_OF_THE_INTERESTS>\ntargeting.gender = \"<GENDER>\" // \"f\" for female, \"m\" for male\nHyBid.setTargeting(targeting)", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "HyBidTargetingModel *targeting = [[HyBidTargetingModel alloc] init];\ntargeting.age = <AGE>;\ntargeting.interests = <ARRAY_OF_THE_INTERESTS>;\ntargeting.gender = \"<GENDER>\"; // \"f\" for female, \"m\" for male\n[HyBid setTargeting:targeting];", "language": "objectivec" } ] } [/block] [block:api-header] { "title": "Logging" } [/block] You can control the level of log that you want to see in your console. As default **`HyBidLogger`** is set to **`HyBidLogLevelDebug`**. There are 5 HyBidLogLevels; - HyBidLogLevelNone - HyBidLogLevelError - HyBidLogLevelWarning - HyBidLogLevelInfo - HyBidLogLevelDebug If you want to set a different HyBidLogLevel in your app, the best place is to do it in the HyBid initialization part. [block:code] { "codes": [ { "code": "HyBid.initWithAppToken(\"<YOUR_APP_TOKEN_HERE>\") { (success) in\n if (success) {\n HyBidLogger.setLogLevel(HyBidLogLevelDebug)\n print(\"HyBid Successfully Initialized\")\n }\n }", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": " [HyBid initWithAppToken:@\"<YOUR_APP_TOKEN_HERE>\" completion:^(BOOL success) {\n if (success) {\n [HyBidLogger setLogLevel:HyBidLogLevelDebug];\n NSLog(@\"HyBid initialisation completed\");\n }\n }];", "language": "objectivec" } ] } [/block] [block:api-header] { "title": "SKAdNetwork" } [/block] **`SKAdNetwork`** is an attribution solution introduced by Apple. It validates advertiser-driven app installations without disclosing user-level data. With the iOS 14 update, the utilization of **`SKAdNetwork`** framework will become more important since IDFA (Apple’s Identifier for Advertiser) is going to be opted-out by default. The 'opted-out by default' setup was originally planned to happen with the release of iOS 14, but has been delayed to early next year. To prepare the change in time, we suggest you to already start adding support for **`SKAdNetwork`**. 1. Add each **`SKAdNetwork`** ID with the key **`SKAdNetworkIdentifier`** as a list to your App's **`Info.plist`** under the key **`SKAdNetworkItems`**. PubNative's SKAdNetwork ID is: **`TL55SBB4FM.skadnetwork`** [block:code] { "codes": [ { "code": "\t<key>SKAdNetworkItems</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>SKAdNetworkIdentifier</key>\n\t\t\t<string>TL55SBB4FM.skadnetwork</string>\n\t\t</dict>\n\t</array>", "language": "xml" } ] } [/block] 2. Set your AppStore ID [block:code] { "codes": [ { "code": " HyBid.setAppStoreAppID(\"NUMERIC_APPSTORE_ID_HERE\")", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "[HyBid setAppStoreAppID:@\"NUMERIC_APPSTORE_ID_HERE\"];", "language": "objectivec" } ] } [/block] ***[Return to the HyBid](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk)*** ***[Return to the MoPub Adapter](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-adapter-for-mopub)*** ***[Return to the MoPub Pre-Bid](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-pre-bid-for-mopub)*** ***[Return to the DFP Pre-Bid](http://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-pre-bid-for-dfp)***