Heyzap Mediation Sdk 10 - Ios [tutorial]

Discussion in 'Advertising' started by Christoph, Dec 12, 2016.

  1. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    Note:
    If you are looking for the Android version get it here!

    This tutorial is for iOS games. It works with Buildbox 2.2.8 which is compatible with Heyzap SDK 10 and above (take note that Buildbox 2.2.9 went back to the more stable SDK 9). It's now pretty much straight forward and easy to use Heyzap's mediation service which you can use for rewarded videos, interstitial ads and/or banners. Interested? Just follow this tutorial step by step and you will have set it up in no time:

    [​IMG]
    UNIFIED PLATFORM - iOS SDK 10 & Xcode
    The unofficial Buildbox Tutorial
    PART 1

    BUILDBOX SETUP
    1. Go to https://developers.heyzap.com/account and copy your Publisher ID (if you do not have an account yet, register first for an account at https://www.heyzap.com/register, then copy your ID)

    2. Open your Buildbox game and go to Project Settings/Advertisements
    3. Select Apple iOS App Store as your Application Store
    4. Paste your Heyzap Publisher ID into the corresponding field
    5. Click on OK

    BB.png

    IMPORTANT: Do not set up any other Ad Networks here because we will run everything through Heyzap Mediation. Leave all other IDs blank. Do not use any Banners or Interstitial Priority List either.

    6. From the Buildbox Flow Chart page, select an UI box (for example Game Over). Under "Advanced Options" on the right sidebar, choose Heyzap for the "Ad Interstitial" and the "Banner" field. Then set the frequency of the ads and repeat this step for all other menus you want Heyzap Mediation ads to appear (Game Field, Pause Menu, Main Menu).
    [​IMG]

    7. Generate your iOS project by selecting File/Export/iOS.

    export.png

    Ignore the Heyzap warning from the pop-up and click on "Continue".

    warning.png


    HEYZAP APPLICATION SETUP

    1. Go back to your Heyzap "Dashboard" (https://developers.heyzap.com/dashboard/) and choose "All apps" and "+ Claim an App" at the top of the left side panel
    [​IMG]

    2. Click on iOS and add your app (if it is not yet in the App Store, click on "clicking here" to add it manually)

    [​IMG]

    Note: to get your Bundle ID go to https://itunesconnect.apple.com, Select "My Apps" and then choose your app. The ID is in the current window under General Information.


    HEYZAP 3rd PARTY AD NETWORK SETUP
    1. Go to your Heyzap Dashboard Integration Wizard (https://developers.heyzap.com/integration_wizard)

    2. Select the Ad Networks you want to set up and click on “Continue".

    ad networks.png

    Note: I personally recommend to use AdMob, Applovin, Facebook, UnityAds and Vungle. I also know of several publishers who use these specific ad networks because they give the best results at the moment.

    3. Select your App and click on “Continue"
    [​IMG]

    4. Add all your credentials from your 3rd party Ad Networks and click each time on “Continue” (you need to register for each Ad Network and setup your app individually before you’ll get all the information needed). You can easily follow the instructions for each ad network provided by Heyzap and use the links available for each credential.

    5. After adding all your credentials - and as a final step - choose “iOS" in the "SDK Integration” tab.

    index-4.png

    6. You should have been re-directed to Heyzap Docs iOS SDK Setup and Requirements page (https://developers.heyzap.com/docs/ios_sdk_setup_and_requirements) and the Ad Networks you chosen previously should have been selected automatically. If not, select them now like that:

    index-3.png

    7. Download the latest Heyzap SDK (from step 2), but don’t install/add it yet.

    index-2.png

    8. Download the latest 3rd-party SDKs (step 4), but don’t install/add them yet.

    index-1.png

    9. From your download folder on your Computer, select all downloaded zip files and drag and drop them into a new folder called "Heyzap SDKs”.
    heyzap zips.png
    10. Uncompress all zipped SDKs and copy all files to another new folder called “Ready to Install”

    Note 1: from your "heyzap-ads-sdk-x.x.x" folder, you only need to copy the "HeyzapAds.framework" and the "FYBHZMediationTestSuite.framework" from the "iOS-sdk” folder. Ignore everything else.

    If you have selected the same ad networks as I did, it looks like that (make sure you copy the embeddedframework files/folders):

    index.png

    Note 2: the folder called "Ready to Install" is not obligatory, but I recommend to do it anyway as with each update or Buildbox export of your game you will need them again and again. So it is very handy to have them ready immediately when you need them.

    11. Leave the Heyzap Docs page open. We still need it later. Now we are ready to work with Xcode. :)
     
    Last edited: Aug 9, 2017
  2. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    [​IMG]
    UNIFIED PLATFORM - iOS SDK 10

    The unofficial Buildbox Tutorial
    PART 2

    XCODE SETUP
    Note: Use Xcode 7.3.1 or later to avoid errors.

    1.Open Xcode and drag your exported ios folder into the app

    2.Click on the small arrow on the left side of your “PTPlayer” project to expand the content and do the same for your “Frameworks” folder. It looks like that:
    ptpplayer expanded.png

    3. Copy all files from your “Ready to Install” folder into the “Frameworks” folder.

    addsdks.png

    4. A pop-up window opens with options for adding new files. Tick "Copy items if needed" as well as "Create groups" and confirm by clicking on the "Finish" button.

    pop-up.png

    5. Now expand in the same way PTPlayer/ios/libs/ and select the file "AppController.mm"
    index-5.png

    6. Go back to the “Setup and Requirements” tab from your Heyzap account and scroll down to
    Step 5 of the document. Copy the huge list of "@importxxxxx;…” (see example screenshot)
    index-6.png

    7. Then go back to Xcode and paste the entire list just beneath the line #import "models/PTModelController.h” in your AppController.mm file.

    index-7.png

    Delete all double entries you may have (no idea why Heyzap does this)

    8. The next step is a little bit tricky. Change each @import to #import and each following element to its file path structure.

    Example: "@import AVFoundation;" changes to:
    Code:
    #import <AVFoundation/AVFoundation.h>
    Normally it’s always the name followed by a diagonal line, the name again, dot and the letter “h"
    appcontrollermm.png

    Note:
    There are two exceptions:
    CoreTelephony is:
    Code:
    #import <CoreTelephony/CoreTelephonyDefines.h>
    and OpenGLES are in fact several files:
    Code:
    //import OpenGLES
    #include <OpenGLES/ES2/gl.h>
    #include <OpenGLES/ES2/glext.h>
    #include <OpenGLES/ES3/gl.h>
    #include <OpenGLES/ES3/glext.h>

    9. In the same AppController.mm file scroll down just a little bit and look for:
    Code:
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    Position your mouse cursor just after the { sign and hit enter. Then copy/paste this code:
    Code:
    // Your Heyzap Publisher ID:
    [HeyzapAds startWithPublisherID: @"00xx4x99885xx62215880xxx3xxx5x1x"];
    It will look like this:

    index-8.png

    10. Go again to your web browser and open in a NEW tab https://developers.heyzap.com/account. Copy your PublisherID and replace the number between the quotation mark (from the previous step) with your own.

    11. Then select your PTPlayer project again at the left side panel in Xcode and it should automatically open the “General” tab. Scroll down to “Linked Frameworks and Libraries” and click at the bottom on the + icon
    AddLibraries.png
    12. Go back to the “Setup and Requirements” tab from your Heyzap account. Just after the huge list of the @import codes you’ll find a list of the libraries you need to add. In my case for example (this changes depending on the ad networks you are using):
    • libc++.tbd
    • libxml2.tbd
    • libz.tbd

    Write the name of the library in the search field of the pop up window in Xcode you just opened before, select the library and click on “Add”. Repeat the same for every library you need to add.

    index-9.png

    Now run the game in the Xcode simulator or on your device! The ads should work 100%.

    That’s it! You just set up Heyzap Mediation for your own game.
    Congratulations!
     
    Last edited: Dec 12, 2016
  3. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    [​IMG]
    UNIFIED PLATFORM - iOS SDK 10

    The unofficial Buildbox Tutorial
    PART 3

    ADDITIONAL SETTINGS

    One last thing to consider is to check and adjust the publisher settings in your Heyzap Dashboard. Select your app on the top left corner and go the the "Publisher Settings" tab.

    index.png

    Here you adjust how the interstitial ads behave.

    Verify if everything works as it should:
    In the tab "Mediation Status" (https://developers.heyzap.com/dashboard/mediation_status) you'll see if your Ad Networks are set up correctly (green).


    TEST YOUR 3rd-PARTY INTEGRATIONS

    When you added all the SDKs in step 1 of this tutorial you also added a Mediation Test Suite. On your device or in the Xcode simulator, you can now test each of the ad networks you've chosen.

    To use the Mediation Test Suite follow these steps:
    1. Add temporarily this code just beneath the Heyzap Publisher ID you put in the AppController.mm file (in step 9 of the Xcode part from this tutorial)
    Code:
    // Create UIWindow
    // Set rootViewController
    [HeyzapAds presentMediationDebugViewController];
    index-1.png

    Then start your game on your device or on the simulator and the Heyzap debug mode will start.

    TestSuiteNetworkList.png

    It lets you pick a network and test it. Only the ad networks that appear in the section "Succesfully Integrated" will work. The networks you have chosen should all appear there now.

    IMPORTANT: This code should be used for testing purpose and is for temporary use only. Once everything is working as it should, delete the code again and export a new build of your Game. Do NOT upload any build with the code enabled to the Apple App Store!!! It will get rejected and/or worse, you publish your game with the test suite enabled.
     
    Last edited: Dec 12, 2016
  4. wesam_badr

    wesam_badr Miniboss Boxer

    Joined:
    Oct 10, 2015
    Messages:
    1,063
    Likes Received:
    479
    thank you christoph for your hard work
     
    SuperVudu and Christoph like this.
  5. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    You are welcome! I still changed some bits for a better understanding. And I saw that some images didn't load. But it should be all fixed now. If you have any problems don't hesitate to ask and if you have any additions please let me know.
     
  6. bluemoonstudios

    bluemoonstudios Avid Boxer

    Joined:
    Oct 8, 2015
    Messages:
    156
    Likes Received:
    56
    That's a very detailed tutorial @Christoph thanks for taking the time mate :)

    unfortunately i am still waiting for 2.2.8 lol
     
  7. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,545
    bluemoonstudios likes this.
  8. newlinecut123

    newlinecut123 Boxer

    Joined:
    Dec 3, 2015
    Messages:
    3
    Likes Received:
    2
    Hi guys thank for providing this helpful article........................... for us!:)
    My name is umrav singh i am using buildbox 2. I have done this ad mediation step before so many time for my game. it was working fine in my previous games. But 4 day ago I did mediation step with my new game but when i checked on the device, ads are not showing :(. previously when ads were not showing, I thought it can be doing to week network. So i have released my game on app store but today when i am checking my Hey-Zap dashboard for impression there where no ad impressions. So i want to know what is the reason behind this problem and i have properly checked all the step of Hey Zap and buildbox . but ads not show.

    Please help me out.....
     
  9. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    Use the test suite SDK that comes with Heyzap 10. This way you can see exactly where the problem is. For further information check out the tutorial above.
     
  10. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Christoph

    thanks for the tutorial been a huge help glad someone has cracked it.

    im using 2.2.8

    and the latest hey zap sdk

    got insterentials and the reward videos working on all ad networks but the banners don't seem to be working. I've only put the banners set as hey zap and have only put the hey zap id in as advise. I've followed the steps three times and getting the same result.

    I'm using the test suite and all networks coming up as integrated
    ad networks using are
    - applovin
    - facebook
    - chartboost
    - vungle

    Also as a separate issue unity ads every time i add it i get this error come up

    Linker Comand failed with exit code 1 (use -v to see invocation)

    and the sdk I'm adding is Fyber.

    Hope you can help, also congrats on your last feature haven't been on here for a while
     
  11. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    Thanks Chris. Not sure what the problem is. When you use the test suite, does facebook deliver the test banner? Facebook is the only one that can deliver banner ads in your list (the other one would be admob). So you need them as well enabled in the facebook dashboard so it can get delivered. Unity Ads shouldn't come up with any error. What do you mean when you add it? I suppose that it is when you run the game? And do you add all SDKs or only Fyber as you say?
     
    Chris Goodman likes this.
  12. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Christoph

    The banner issue is resolved it wasn't activated at my publishers end and yeah after looking at it only admob and facebook are the only ones that do banners,

    What I meant with unity issue is only when I add the framework for unity does it come up with that error when I try to build to device and gives a failed build

    And the only frame work I added for unity is the fyber one as I noticed another unity frame work in the download from hey hey zap do I add both?
     
  13. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,545
    I downloaded the Unity framework from HeyZap to see if there were any notes that would explain any issues. Did you "add the .embeddedframework to your project." as HeyZap indicates? It sounds like you drilled down into the embeddedframework and included only part of what you should have.
     
  14. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Andy
    if i add the .embeddedframwork on the any net work other than chartboost it says on test suite that sdk not intergrated
    ill drilled it down to the fyber......... .framework it works fine on all networks apart from the unity.

    ive gone over the steps again today three times if i add the unity .embeddedframework it will build to device but sdk not intergrated as advised on the test suit.

    i think since there latest update with hey zap the frame works you drag in are not .embeddedframework but is now .framework which seems to work with all the other networks.

    ive emailed heyzap they directed me back to the thread

    the version i have downloaded of unity sdk is 2.0.5
    the hey zap sdk is 10.2.2

    i think ill try now all the sdks attached to 10.2.0 and see if this makes a difference
     
  15. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Andy
    Have tried 10.2.0 same problem again.

    @Christoph

    what unity sdk are you using and hey zap version?

    also what is the exact file name for unity are you dragging into the framework folder on the xcode project?

    because if i drag the .embeddedframwork file in it builds but on test suit says sdk not integratied and no unity ads show.

    on all other networks except chartboost if i drag the .embeddedframework it also will build but on test suit say not intergraded
    if i drag the fyber...... .framework ads work fine and shows up on test suit.

    as im really stumped on this

    this is import list im using for all my ad networks as i thought i have missed something i trippled check this on heyzap website

    (plus side they seem to have stopped duplicating the liston the web site)

    #import <AVFoundation/AVFoundation.h>
    #import <AdSupport/AdSupport.h>
    #import <AudioToolbox/AudioToolbox.h>
    #import <CFNetwork/CFNetwork.h>
    #import <CoreData/CoreData.h>
    #import <CoreGraphics/CoreGraphics.h>
    #import <CoreImage/CoreImage.h>
    #import <CoreLocation/CoreLocation.h>
    #import <CoreMedia/CoreMedia.h>
    #import <CoreMotion/CoreMotion.h>
    #import <CoreTelephony/CoreTelephonyDefines.h>
    #import <CoreVideo/CoreVideo.h>
    #import <Foundation/Foundation.h>
    #import <GLKit/GLKit.h>
    #import <MediaPlayer/MediaPlayer.h>
    #import <MessageUI/MessageUI.h>
    //import OpenGLES
    #include <OpenGLES/ES2/gl.h>
    #include <OpenGLES/ES2/glext.h>
    #include <OpenGLES/ES3/gl.h>
    #include <OpenGLES/ES3/glext.h>
    #import <QuartzCore/QuartzCore.h>
    #import <SafariServices/SafariServices.h>
    #import <Security/Security.h>
    #import <StoreKit/StoreKit.h>
    #import <SystemConfiguration/SystemConfiguration.h>
    #import <UIKit/UiKit.h>
    #import <VideoToolbox/VideoToolbox.h>
    #import <WebKit/Webkit.h>
    #import <HeyzapAds/HeyzapAds.h>

    and are you getting it confirmed on test suit that unity is intergrated?

    if you could try and use they latest heyzap sdk and unity sdk and test it on your end that would be a massive help?

    thanks for all the help
     
  16. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,808
    Likes Received:
    2,308
    Yeah. All yes. If you want shoot me a PM and I can take a look with Teamviewer. As Andy says you have to use the embbededframeworks folder. The screenshot from the specific step shows the version number I'm using by the way. I think it's the latest.
     
    bmsingha likes this.
  17. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Christoph
    sorry i sound stupid but whats a PM?

    here is what I've done

    Screenshot 2016-12-17 15.11.37.png
    so you can see I've added it how you are saying with the .embeddedframework at the end

    here is the import list I'm using

    #import <AVFoundation/AVFoundation.h>

    #import <AdSupport/AdSupport.h>

    #import <AudioToolbox/AudioToolbox.h>

    #import <CFNetwork/CFNetwork.h>

    #import <CoreData/CoreData.h>

    #import <CoreGraphics/CoreGraphics.h>

    #import <CoreImage/CoreImage.h>

    #import <CoreLocation/CoreLocation.h>

    #import <CoreMedia/CoreMedia.h>

    #import <CoreMotion/CoreMotion.h>

    #import <CoreTelephony/CoreTelephonyDefines.h>

    #import <CoreVideo/CoreVideo.h>

    #import <Foundation/Foundation.h>

    #import <MessageUI/MessageUI.h>

    #import <MediaPlayer/MediaPlayer.h>

    #import <QuartzCore/QuartzCore.h>

    #import <SafariServices/SafariServices.h>

    #import <Security/Security.h>

    #import <StoreKit/StoreKit.h>

    #import <SystemConfiguration/SystemConfiguration.h>

    #import <UIKit/UIKit.h>

    #import <VideoToolbox/VideoToolbox.h>

    #import <WebKit/WebKit.h>

    #import <HeyzapAds/HeyzapAds.h>

    //import OpenGLES

    #include <OpenGLES/ES2/gl.h>

    #include <OpenGLES/ES2/glext.h>

    #include <OpenGLES/ES3/gl.h>

    #include <OpenGLES/ES3/glext.h>

    Screenshot 2016-12-17 15.11.58.png






    and this is what I'm getting when i load the game


    IMG_0385.PNG.png

    if i add the .framework everything works but not unity
     
  18. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Christoph

    So same Xcode project
    i deleted the .embbedframework

    and replaced with the .framework

    Screenshot 2016-12-17 15.37.46.png

    built to device

    and here is what test suit is saying and showing adds IMG_0386.PNG.png
     
  19. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    @Christoph

    I'm cool these ad networks seems working fine happy days just the unity one but by your method it should work with embedded

    lol PM = private message
     
  20. Chris Goodman

    Chris Goodman Boxer

    Joined:
    Oct 5, 2015
    Messages:
    65
    Likes Received:
    64
    FINALLLYYYYYYYYY

    @Andy
    @Christoph

    All Because i didn't tick the Create Groups when copying over loooooooooool

    Thanks for all the help guys
     
    Andy likes this.

Share This Page