मैं अपने ऐप में इंटरस्टिशियल विज्ञापनों को लागू करने के लिए स्विफ्ट का उपयोग कर रहा हूं। मैंने इसे अंतरालीय विज्ञापन दिखाने में कामयाब रहा है, लेकिन विज्ञापन से छुटकारा पाने के लिए कोई करीबी 'एक्स' बटन नहीं है। ऐसा क्यों है?इंटरस्टिशियल आईएडी के पास कोई करीबी 'एक्स' बटन नहीं है
5
A
उत्तर
1
मुझे यह भी नहीं मिला कि अंतर्निहित ढांचा बंद बटन प्रदान क्यों नहीं करता है लेकिन मैं निम्नलिखित समाधान का उपयोग करने के साथ समाप्त होता हूं।
//iAD interstitial definition with custom placeHolderView and close button
//you do not need to add anything to interface builder. All is done with code
var interstitial:ADInterstitialAd!
var placeHolderView:UIView!
var closeButton:UIButton!
//Full Implemantation of iAD interstitial and delegate methods
func cycleInterstitial(){
// create a new interstitial. We set the delegate so that we can be notified
interstitial = ADInterstitialAd()
interstitial.delegate = self;
}
func presentInterlude(){
// If the interstitial managed to load, then we'll present it now.
if (interstitial.loaded) {
placeHolderView = UIView(frame: self.view.frame)
self.view.addSubview(placeHolderView)
closeButton = UIButton(frame: CGRect(x: 270, y: 25, width: 25, height: 25))
//add a cross shaped graphics into your project to use as close button
closeButton.setBackgroundImage(UIImage(named: "cross"), forState: UIControlState.Normal)
closeButton.addTarget(self, action: Selector("close"), forControlEvents: UIControlEvents.TouchDown)
self.view.addSubview(closeButton)
interstitial.presentInView(placeHolderView)
}
}
// iAd Delegate Mehtods
// When this method is invoked, the application should remove the view from the screen and tear it down.
// The content will be unloaded shortly after this method is called and no new content will be loaded in that view.
// This may occur either when the user dismisses the interstitial view via the dismiss button or
// if the content in the view has expired.
func interstitialAdDidUnload(interstitialAd: ADInterstitialAd!){
placeHolderView.removeFromSuperview()
closeButton.removeFromSuperview()
interstitial = nil
cycleInterstitial()
}
func interstitialAdActionDidFinish(_interstitialAd: ADInterstitialAd!){
placeHolderView.removeFromSuperview()
closeButton.removeFromSuperview()
interstitial = nil
println("called just before dismissing - action finished")
}
// This method will be invoked when an error has occurred attempting to get advertisement content.
// The ADError enum lists the possible error codes.
func interstitialAd(interstitialAd: ADInterstitialAd!,
didFailWithError error: NSError!){
cycleInterstitial()
}
//Load iAd interstitial
func dislayiAdInterstitial() {
//iAd interstitial
presentInterlude()
}
func close() {
placeHolderView.removeFromSuperview()
closeButton.removeFromSuperview()
interstitial = nil
}
0
बीचवाला = InterstitialAd() का उपयोग कर मुझे आप के रूप में एक ही समस्या का कारण बनता है।
हालांकि, अगर आप अपने AppDelegate के आवेदन समारोह में यह कोड शामिल: फिर
UIViewController.prepareInterstitialAds()
, यदि आप किसी मध्यवर्ती विज्ञापन इस का उपयोग करते हुए उत्पन्न कर सकते हैं:
viewController.requestInterstitialAdPresentation()
मुझे यकीन है कि कैसे प्राप्त करने के लिए नहीं कर रहा हूँ हालांकि, कॉलबैक।
0
आईओएस 9.2.1, Xcode 7.2.1, एआरसी सक्षम
कृपया मेरे पोस्ट पढ़ें:
https://stackoverflow.com/a/35467510/4018041
मैं अभी भी presentFromViewController:
विधि का उपयोग करें।
आशा है कि इससे मदद मिलती है! चीयर्स।
संबंधित मुद्दे
- 1. आईएडी इंटरस्टिशियल डिवाइस पर काम नहीं कर रहा है
- 2. HttpWebRequest की कोई करीबी विधि नहीं है?
- 3. jQuery UI संवाद में करीबी (एक्स) बटन के लिए समर्पित ईवेंट हैंडलर
- 4. आईपैड पर आईएडी: लैंडस्केप आईएडी सही ढंग से ओरिएंटेड नहीं
- 5. आईएडी बैनर काम नहीं कर रहा है
- 6. बिगइंटर के पास कोई सीमा नहीं है?
- 7. आईएडी लैंडस्केप अजीब दृश्य व्यवहार
- 8. फेडोरा 16 पर ग्रहण में एंड्रॉइड एसडीके और एवीडी प्रबंधक - कोई करीबी विंडो बटन
- 9. आईएडी रीड्रेश नेटवर्क डिस्कनेक्शन
- 10. jQuery के करीबी IE8 में काम नहीं करता है/9
- 11. कोणीय यूआई बूटस्ट्रैप पॉपओवर एक करीबी बटन जोड़ना
- 12. UINavBar के पास अन्य बटन
- 13. आईएडी बैनर प्रश्न
- 14. एंड्रॉइड विज्ञापन इंटरस्टिशियल कैसे बनाएं?
- 15. AdMob इंटरस्टिशियल त्रुटि "अनुरोध त्रुटि: दिखाने के लिए कोई विज्ञापन नहीं"
- 16. सीक्वेलिज़ एसोसिएशन के पास है, कोई है
- 17. आईएडी भुगतान विवरण
- 18. क्यों Iterator के पास कोई रीसेट विधि नहीं है?
- 19. PHP के पास कोई डिफ़ॉल्ट कन्स्ट्रक्टर क्यों नहीं है?
- 20. वर्ग "व्यू कंट्रोलर" के पास कोई प्रारंभिक नहीं है
- 21. रूबी के पास कोई निरंतर मूल्य नहीं है?
- 22. सी ++ समेककों के पास कोई वर्चुअल फ़ंक्शन नहीं है?
- 23. इंटरफ़ेस सदस्यों के पास कोई एक्सेस संशोधक क्यों नहीं है?
- 24. इंटरस्टिशियल टाइमआउट का मतलब प्रवेश में क्या है?
- 25. PHP: करीबी आउटपुट स्ट्रीम
- 26. डेस्कटॉप पर यूडब्ल्यूपी शीर्ष एक्स बटन द्वारा बंद - कोई घटना
- 27. कोई एक्स 11
- 28. यदि उपयोगकर्ता बंद ('एक्स') बटन
- 29. रेगेक्स - केवल उन नंबरों को कैप्चर करें जिनके पास उनके पास कोई पत्र नहीं है
- 30. ऐप्पल आईएडी बैनर के इंप्रेशन की गणना कैसे करता है?