2016-12-07 26 views
0

我正在iOS SDK上集成SDK HeyZap。HeyZap(SDK 10.2.1)IOS代理函數不叫

我可以獲取()和顯示()一個IncentivizedAd。

但我不能使用回調委託功能。

的三種方式不適合我(工作的通知,對(HZIncentivizedAd.ShowWithOptions),並與HZAdsDelegate完成,HZIncentivizedAdDelegate在我的類中聲明。

class GridLigueController: MyViewController, UITableViewDataSource, HZAdsDelegate, HZIncentivizedAdDelegate { 

func didShowAdNotificationHandler() { 
    print("didShowAdNotificationHandler") 
} 

// Configure with NSNotification Listener 
// function called on viewDidLoad 
func configureRewardVideo() { 

    HZIncentivizedAd.setDelegate(self) 
    NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(didShowAdNotificationHandler), name:HZMediationDidShowAdNotification, object:nil) 
    if adRequestInProgress == false && HZIncentivizedAd.isAvailable() == false { 
     HZIncentivizedAd.fetch() 
     adRequestInProgress = true 
     print("[Debug] - adRequestInProgress...") 
    } else { 
     print("[Debug] - Reward video not ready : \(adRequestInProgress)") 
    } 

// Completion on showWithOptions 
func completion(success: Bool, error: NSError!) -> Void { 
    if success { 
     print("success showing an ad") 
    } else { 
     print("error showing an ad; error was %@",error) 
    } 
} 

func showAd() { 
    if HZIncentivizedAd.isAvailable() { 
     let options = HZShowOptions() 
     options.viewController = self 
     options.completion = self.completion 
     HZIncentivizedAd.showWithOptions(options) 
     print("[Debug] - HZIncentivizedAd video is ready, should be shown") 
    } else { // show an alert } 
} 

// Normal Delegate function 
func didReceiveAdWithTag(tag: String!) { 
    print("didReceiveAdWithTag") 
} 

func didShowAdWithTag(tag: String!) { 
    print("didShowAdWithTag") 
} 

func didFailToCompleteAdWithTag(tag: String!) { 
    print("didFailToCompleteAdWithTag") 
} 

func didCompleteAdWithTag(tag: String!) { 
    print("didCompleteAdWithTag") 
} 

} 

難道我忘了什麼東西來初始化? 我使用的Xcode 7.3.1與雨燕2.3

謝謝你幫我

回答

1

Heyzap 10.2.1確實遇到了回調問題。我們的網站在發佈後很快就離開了我們的網站,並將擁有10.2.2。今天出去取代它。不便之處!

來源:我在Heyzap工作

0

HeyZap給我發了消息和SDK版本我用(10.2.1)的回調有一個問題。

現在工作正常。