A thin wrapper around the Unity Ads Android and iOS SDK for use on Heyzap's mediation.
The latest release can be found in Releases.
Pull requests and issues are welcome.
- iOS: 2.1.0
- Android: 2.1.0
-
Add the
UnityAds.ane
to your Adobe Flex Builder or Adobe Flash project. -
If on Android, follow the integration instructions on Heyzap or add the following permissions and activities to your Android Manifest in your application descriptor:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" />
<activity android:name="com.unity3d.ads.adunit.AdUnitActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:hardwareAccelerated="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> <activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:hardwareAccelerated="false" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
-
If not done automatically, add the follow extension context to your application descriptor:
<extensions> <extensionID>com.heyzap.sdk.extensions.unityads</extensionID> </extensions>
For iOS:
- Replace
UnityAds.framework
andUnityAds.bundle
inios/Vendor
with a newer version. - Update
ios/platform.xml
with any new iOS frameworks that the newer version might be dependent on. Built-in iOS SDK frameworks can be added within the linkerOptions tag. Custom iOS frameworks can be added under the packagedDependencies tag and their respective.framework
directories can be added toios/Vendor
. Drag and drop these.framework
directories into theUnityAdsANE.xcodeproj
project in XCode under the Vendor group.
For Android:
- Replace
unity-ads.jar
inandroid/libs
with a newer version. - Update
android/platform.xml
with any new android libraries that the newer version might be dependent on. Android libraries can be added under the packagedDependencies tag. The actual.jar
files can be added to theandorid/libs
directory.
After making the necessary modifications, build the new ANE by following the building instructions below.
New versions of Unity Ads contain new .AAR archive. Just unpack it as zip file and add classes.jar file to android/libs
directory. Rename it to unityads.jar
.
Copy all resources to src-resources
folder. They will be automatically added to the build.
- Mac OS X
- XCode
- Apache Ant
- AIR SDK
- Make a
build.config
by copyingbuild.config.dist
(your local config file) - Change the path to the AIR SDK in
build.config
(namedair.sdk
) - From the root of the repository, run
ant
.
After build completes, the native extension will be in bin/UnityAds.ane
.