London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
6.3 C
New York
Saturday, February 1, 2025

ios – The way to insert Adsterra advert between content material in WkWebView?


i made ios app with my WordPress Web site utilizing Relaxation api to show content material in WkWebView. now what’s need is to show Adsterra community advert after half content material and i’ve written code like this..


let htmlString: String = "<html><head><type kind="textual content/css"> physique {font-family: "SFUIText-Common"; text-align: justify;  } img { max-width: 100%; width: auto; peak: auto; } iframe { max-width: auto; width: auto; peak: auto; }</type> </head><physique>" + self.webContent + "</physique></html>"

let halfwayIndex = htmlString.index(htmlString.startIndex, offsetBy: htmlString.depend / 2)

let htmlBeforeAd = String(htmlString.prefix(upTo: halfwayIndex))
let htmlAfterAd = String(htmlString.suffix(from: halfwayIndex))

//Advert Code Right here
let adCode = "<div><script kind="textual content/javascript"> atOptions = { 'key' : '6d9a5a16b8cff8984586ef********', 'format' : 'iframe', 'peak' : 250, 'width' : 300, 'params' : {} }; doc.write('<scr' + 'ipt kind="textual content/javascript" src="//www.profitablecreativeformat.com/6d9a5a16b8cff******ef06b5afd1be/invoke.js"></scr' + 'ipt>'); </script></div>"

let htmlStringWithAd = htmlBeforeAd + adCode + htmlAfterAd
self.webView.loadHTMLString(htmlStringWithAd, baseURL: nil)

when is use

let adCode = "<div>your advert code right here</div>"
`

i can see "your advert code right here" after half content material however not the advert.. can anybody please assist me out ?

i've additionally tried 

`<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>`

and this:

    ```
    let webConfiguration = WKWebViewConfiguration()
    webConfiguration.preferences.javaScriptEnabled = true
    
    let webView = WKWebView(body: .zero, configuration: webConfiguration)
    
    ```

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com