This repository is used to create the mopub xamarin bindings for iOS. It currently has support for GoogleAdMob, Facebook banner ads and Vungle and Facebook video (interstitial) ads.
Version info:
- MoPub version 5.1.0 github
- GoogleAdMob version 7.31.0 googleAdMob
- Vungle version 6.2.0 website
- Facebook Audience Network 4.28.1 website
The MoPub folder contains 2 sub projects: one is Xcode project for building the MoPub framework which is then used in the second subproject which is a binding into the C# .dll library. The Xcode project is setup to build framework and uses MopubSDK source code provided by Mopub. Also Mopub supports other ads providers that are interacted via plugins and require corresponding SDK frameworks being downloaded from the providers and copied into the Mopab Xcode project. Taking into acount this structure the update process will consist of the following steps:
- Open Xcode project and remove old MoPubSDK folder
- Drag updated version of MoPubSDK into your Xcode project
- From a separate repository fetch corresponding folders with the required ad adapters and drag the appropriate whole folders into the root of Mopub Xcode project so they are at the same level with MoPubSDK and MoPub subfolders
- Add appropriate (updated) ad networks SDKs in corresponding (just added) folders.
- Make sure Xcode project is built without errors.
- Within Terminal, navigate to the mopub-framework folder
- Run 'bash universal-frameworks.sh' in that directory (that builds a fat library)
- Open mopub-ios-binding/mopub-ios-binding.sln in VisualStudio - rework the binding methods and enums
- Rebuild that solution.
- Copy the resulting bin//MoPubSDK.dll to your own VisualStudio project.
Keep in mind:
- that the built MoPub framework contains the other providers SDKs inside.
- when MoPub framework is added into the Xamarin binding project the framework link is added under Native References.
- the settings of linked frameworks and weak frameworks are filled in the properties of the framework when it is selected under Native References.
- the file Mopub.framework.linkwith.cs IS NOT USED and is only left for reference to have a list of the required frameworks at hand (the build action for that file is None).
- ApiDefinitions.cs and StructsAndEnums.cs only contains code of the used API calls and in case some other methods or properties are needed one may need to extend the binding with those additional methods, properties or enums.