Recently I moved from AdMob to MoPub because I wanted to use a mediation and try out Facebook Audience Network and AdMob rather than stick to just AdMob. Also, MoPub is very good in terms of revenue generation.
Implementing on my Android app was a breeze. It was so easy and simple and the documentation was clear enough. But when it came to implementing in iOS using Swift, their documentation, without a lack of better word, sucks big time. It’s written in Obj C and although the sample app is written in Swift, it is very difficult to follow. It took me lots of searching to find one article which helped me, but that too was bit outdated. So, naturally I thought it would be better to put these in an article for someone else to use.
Things you need:
An active, approved MoPub account with running ad units
An iOS app, written in Swift
Integrate:
I used CocoaPods to integrate MoPub SDK into my app. For that, I added the following to my pod file and ran pod install
platform :ios, '13.0'
target '<Your target>' do
use_frameworks!
<Other Pods>
pod 'mopub-ios-sdk'
end
Initialize:
Add the following lines to your AppDelegate file under didFinishLaunchingWithOptions function.