I have integrated Facebook audience network to show ads,
Code:
if (fbInterstitialAd.isAdValid == YES) {
[fbInterstitialAd showAdFromRootViewController:viewController];
}
but getting this crash while showing ad:
*** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'showAdFromRootViewController may only be called once'
Note:
While running on Native iOS it was working, but when I tried to run it on Unity then crashing.
This thread didn't help me: https://twittercommunity.com/t/crash-in-showadfromrootviewcontroller/47005
Currently, FBInterstitialAd is limited to show only once. If an app is trying to show it more than once, the 'InvalidOperationException' will be throwed.
First, please add try/catch around the method '[fbInterstitialAd showAdFromRootViewController:viewController];' to avoid crash.
Second, to verify your integration and make sure the object 'fbInterstitialAd' is not showed more than once.