...
Do iOS Get Started all the way until finishing step 35
Step
...
summary
Add The initialization code.
Create the Channel between web and native with
R89SDK.shared.configureWebView()
method.Use
R89SDK.shared.loadUrlWithConsentDataOrWait()
to load your URLs into the web view.Test everything is working.
Change everything to production code.
Your app is now prepared for monetization with us.
...
Info |
---|
If you want to have native ads to be triggered from the webview we recommend using the manual configuration alongside some kind of javascript interface implemented in the web side to trigger native code, although first finish this whole guide and then go to the manual |
Create the
...
channel
Right after Initialization, you should use the following methods
Code Block | ||
---|---|---|
| ||
import UIKit import R89SDK import WebKit class ViewController: UIViewController, WKNavigationDelegate { @IBOutlet var wkWebView: WKWebView! ... override func viewDidLoad() { super.viewDidLoad() ... let url = <YOUR-URL> wkWebView.navigationDelegate = self // This helps the channel to identify this as an app let userAgent = R89SDK.shared.getUserAgent( webView: wkWebView, siteName: <YOUR-SITE-NAME>) R89SDK.shared.configureWebView(webView: wkWebView, userAgent: userAgent) ... } } |
...
Use the following method to replace any webview.load()
methods method usages you might have
Code Block | ||
---|---|---|
| ||
R89SDK.shared.loadUrlWithConsentDataOrWait(webView: wkWebView, url: url) |
Note |
---|
This url must only be the urls related to you content, or own. Other urls can be loaded normally. with |
Go into production
Remove the methods
R89SDK.shared.setDebug()
.Change the
GADApplicationIdentifier
in theinfo.plist
for the production one.Change the
appId
andpublisherId
in the initialization method for the production ones.Change the
r89ConfigId
in the formats for the production ones.it’s also recommended to remove
R89SDK.shared.setLogLevel(level: LogLevels.debug)
but not needed.
...