2017-01-15 13 views
1

をロードしない、MoPub出力Mopub間質は、IOSのバージョンが10.2で、私はMoPubチュートリアルでテストIDと格子間をmopubテストしようとしています

2017-01-15 13:47:46.801224 Twit Miner[23775:6627095] MOPUB: Looking for custom event class named MPHTMLInterstitialCustomEvent. 
2017-01-15 13:47:46.801321 Twit Miner[23775:6627095] MOPUB: Loading MoPub HTML interstitial 
2017-01-15 13:47:46.999975 Twit Miner[23775:6627095] MOPUB: MoPub HTML interstitial did load 

しかし、私が表示されているすべてのインタースティシャル広告が表示されません。ログはそう示唆

import UIKit 
import MoPub 

class ViewController: UIViewController 
, MPInterstitialAdControllerDelegate 

{ 
    // TODO: Replace this test id with your personal ad unit id 
    var interstitial: MPInterstitialAdController = 
     MPInterstitialAdController(forAdUnitId: "77ce0b65cf81438eb255695afe3b1904") 

    override func viewDidLoad() { 
     super.viewDidLoad() 

     self.interstitial.delegate = self 
     // Pre-fetch the ad up front 
     self.interstitial.loadAd() 
    } 

    func interstitialDidLoadAd(interstitial: MPInterstitialAdController) { 
     // This sample automatically shows the ad as soon as it's loaded, but 
     // you can move this showFromViewController call to a time more 
     // appropriate for your app. 
     if (interstitial.ready) { 
      interstitial.showFromViewController(self) 
     } 
    } 
} 

にもかかわらず、私はブレークポイントを置くとき、私はinterstitialDidLoadAdメソッドが呼び出されないさんことに気づいた:あなたは以下の私のコードを見つけることができます。

<key>NSAppTransportSecurity</key> 
    <dict> 
     <key>NSAllowsArbitraryLoads</key> 
     <true/> 
     <key>NSAllowsArbitraryLoadsForMedia</key> 
     <true/> 
     <key>NSAllowsArbitraryLoadsInWebContent</key> 
     <true/> 
    </dict> 

はまだ運が、誰かが私はおそらく間違ってやっているものを私に伝えることができません:私は、ATSはので、私はInfo.plistファイルに次のキーを追加し、それが原因かもしれないと思いましたか?

答えて

0

私はこれが遅すぎるかもしれないことを認識します。

A location manager (0x143ebb150) was created on a dispatch queue 
executing on a thread other than the main thread. It is the 
developer's responsibility to ensure that there is a run loop running 
on the thread on which the location manager object is allocated. In 
particular, creating location managers in arbitrary dispatch queues 
(not attached to the main queue) is not supported and will result in 
callbacks not being received. 

だけ前に:あなたは、ログエントリ次している場合

チェック

MOPUB: Interstitial controller is loading ad with MoPub server URL: 

もしそうなら、このようなメインキューに派遣loadAd方法を試してみてください。

のObjective-C

dispatch_async(dispatch_get_main_queue(), ^{ 
    [self.interstitial loadAd]; 
}); 

DispatchQueue.main.async { 
    self.interstitial.loadAd() 
} 
スウィフト
関連する問題