Saturday 28 March 2015

Hi, I'm a new to Unity and recently I have finished my second game project and as both my project has no IAP(in app purchase)  Ads is the only option for me to get some revenue and implementing admob in unity for android work fine for me but when it come to iOS it is a little bit tweaky.

As This is my First blog and I'm not from english contry I will straight come to the points and steps you need to do in ios for implementing admob.

Requirements:

 1.Googleads-Mobile-Plugin 

     which you can download from here :Googleads-mobile-plugin

2. iOS-Admob-SDK

        Can be Downloded from here:iOS-Admob-SDK

#NOTE: Remember these plugin keep on updating and changes with time so if these doesn't work for you i have provided the dropbox link to the plugin that i have implementing.

I have used  iOS-admob-sdk 7.0
                                                 

                                                              OR


Here is the dropbox link to all to which i have implemented mine:googleads-mobile-plugin && iOS-SDK



Steps :

#1:

Open your Googleads-mobile-plugin folder that you downloaded and Go to :googleads-mobile-plugins\unity\source\Assets folder and you'll find there Googlemobile ads and plugin folder Drag and drop both of the folder into your unity asset hierarchy.

#2: 

Also Drag and drop the script from:googleads-mobile-plugins\unity\samples\HelloWorld\ Assets.
i.e GoogleMobileAdsDemoScript.cs Script.
#NOTE: Add GoogleMobileDemoScript to any Gameobject So that it execute at run time in unity.

#3:

Open your GoogleMobileAdsDemoScript.cs Script and insert your Admob Banner and Interstitial Ids which you can from your admob account.

That's all we need from Unity now Build your project in iOS and Run the Xcodeproject

#4:  

Now you remember we have downloaded the iOS-Admob-SDK now is the time to use it. In your Xcodproject Go to build setting => add framework +> other framework=>iOS-Admob-SDK folder =>GoogleMobileAds.framework.



#5:

Make sure these framework are already added if not add them as they are the built in framworks
  • AdSupport
  • AudioToolbox
  • AVFoundation
  • CoreGraphics
  • CoreTelephony
  • EventKit
  • EventKitUI
  • MessageUI
  • StoreKit
  • SystemConfiguration

#6: 

This is the last and most important step and  it took me 2-days to find it:
Go to build setting and set Enable modules(C and Objective C) => yes.
you can find this under build setting=>Apple LLVM 6.0-Language and Modules.
                                                                      Or 
      You can just go to bulid setting and type enbale module in the search bar .

That's All we need to do right now now build your project and ta da its working all fine.
Thats what work for hope you'll find it usefull and sorry for my bad english if you misinterpret something.