Unity Mobile Plugin Bundle

Thanks for purchasing the Unity Mobile Plugin Bundle. This guide will take you through setting up the plugin and deploying to both Android and iOS.

For a quick overview/introduction please check out the video here.

Setting Up AdMob

  • Drag the ‘Ads’ prefab into your scene (in the ‘Plugins\Admob’ folder)
  • Click the ‘Ads’ GameObject and enter your Ad Unit ID’s

Setting Up Google Play Game Services

  • Drag the ‘GPGSGUI’ and ‘GPGSManager’ prefabs into your scene (in the ‘Plugins\GPGS’ folder’
    • Click on the GPGSManager GameObject and enter your ID’s and AchievementName’s
    • You can now post scores and achievements by:
      • Messenger<string>.Broadcast(“UnlockAchievement”,”AchievementName”);
      • Messenger<int>.Broadcast(“SubmitScore”,12345);
  • Click ‘Google Play Games’ in the top menu, click ‘Android Setup’ and/or ‘iOS Setup’ and follow the on-screen instructions

Setting Up In-App Purchases

  • Drag the ‘InAppBilling’ prefab into your scene (in the ‘Plugins\InAppBilling’ folder)
  • Click on the ‘InAppBilling/Products’ game object and enter your Android public key
  • Expand the ‘Products/Remove Ads’ and amend the product id’s as necessary

Deploying To Android

  • Switch Unity to Build for Android
    • File-> Build Settings->Android->Switch Platform
  • Amend your Product Name, Keystore password,Bundle Identifier,Version
    • File-> Build Settings->Player Settings
  • Build and Run Your Game
    • File->Build Settings->Build and Run

Deploying To iOS Devices (iPad/iPhone)

  • Make sure you have run the Google Play Game Services Setup for iOS (see above)
  • Switch Unity to Build for iOS
    • File-> Build Settings->iOS->Switch Platform
  • Amend your Product Name, Bundle Identifier,Version
    • File-> Build Settings->Player Settings
  • Amend the Target iOS Version to 6.0
    • File-> Build Settings->Player Settings->Other Settings->Optimization-Target iOS Version -> 6.0
  • Build Your Game
    • File->Build Settings->Build
  • You will get an error in Xcode (GooglePlayGames.h file not found), don’t panic, you need to add some frameworks…
  • The following frameworks need adding in Build Phases->Link Binary With Libraries
    • AdSupport, AddressBook, AssetsLibrary, CoreData, CoreLocation, CoreTelephony, StoreKit, MessageUI, CoreText, Security, lic++dylib, libz.dylib
  • The following frameworks need to be dragged on to the Unity-iPhone project (unzip the included ‘GoogleFrameworksForiOS.zip‘ or download latest from here)
    • GoogleOpenSource.framework, GooglePlus.bundle, GooglePlus.framework,GooglePlayGames.bundle, GooglePlayGames.framework
  • Add the -ObjC flag
    • Build Settings->Other Linker Flags-> add -ObjC to the end of the list
  • The game should now build without errors

Leave a Reply

Your email address will not be published. Required fields are marked *