iOS SDK

Prerequisites

  1. Copy and save your API KEY and API SECRET
  2. Download the Wannads iOS SDK framework

Steps to import Wannads iOS SDK Framework

  1. Add .framework file to project
  2. Add .framework to target Embeded Binaries. Target Settings General Embedded Binaries
  3. Allow ArbitraryLoads in Info.plist
    <key>NSAppTransportSecurity</key>
    <dict>
     <key>NSAllowsArbitraryLoads</key><true/>
    </dict>

    UIViewController class (before the first usage of Wannads SDK)

    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
    
        // Wannads SDK init
        [[WannadsSDK sharedInstance] initWithApiKey:@"" andSubId:@""];
    
        // Optional parameters
        [[WannadsSDK sharedInstance] setAge:27];
        [[WannadsSDK sharedInstance] setSubId2: @"subdId_2_example"];
        [[WannadsSDK sharedInstance] setGender: MALE];

    Showing offers

    [WannadsSDK sharedInstance] showOffersFromController:self];

    Optionally, you can choose a category to filter the offers shown. The complete list of available categories can be reviewed here.

    [[WannadsSDK sharedInstance] showOffersWithCategory:@"surveys" fromController:self];