Nend Ads Do Not Appear When I Build with Monaca

Asked 2 years ago, Updated 2 years ago, 99 views

The Monaca debugger allows you to view ads with reference to the official document, but does not display ads at all when built on a real machine.
The version of Cordova is 5.2.0.
If you have encountered this phenomenon or have any know-how, I would like your advice.Thank you for your cooperation.

monaca nend

2022-09-30 12:07

1 Answers

Try adding the following code to config.xml.

<preference name="monaca:DisableCookie" value="false"/>

12/17 Add

The code that actually works is as follows.
After updating to Cordova 5.2, the advertisement disappeared, investigated the difference between the previous version and added the above code to config.xml and it worked.

HTML

<div id="nend_wrapper"><script type="text/javascript" src="http://js1.nend.net/js/nendAdLoader.js"></script><>

JavaScript

varnend_params={"media":xx, "site":xxxx, "spot":xxxx, "type":x, "orriented":x};

addEventListener("load", function(){
    setTimeout(function(){
        varnendAdSpace= document.querySelector("div[id^=nend_adspace]");
        varnendAdAnchors=nendAdSpace.querySelectorAll("a");
        for (vari=0;i<nendAdAnchors.length;i++) {
            (function(){
                var hrefShelter=nendAdAnchors[i].href;
                nendAdAnchors[i].removeAttribute("href");
                nendAdAnchors[i].addEventListener("click", function(){
                    window.open(hrefShelter, "_system", "location=no");
                }, false);
            })();
        }
    }, 3000);
}, false);

12/17 Re-add

In the example above, the InAppBrowser plug-in is required.
Based on your comment, this is probably the symptom.


2022-09-30 12:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.