The RoktWebView SDK for iOS is a custom WebView that opens Rokt links in an external browser instead of in the same WebView.
For more information, please visit here
The below instructions assume that you are replacing the WKWebView for iOS with the Rokt WebView. The overall process is very simple to complete and the exact approach will depend on whether the WebView is initialised programmatically or not.
Add the Rokt WebView SDK pod to the pod file
use_frameworks!
pod 'RoktWebViewSDK'
In storyboard, replace WKWebView with RoktWKWebView Custom Class.
Alternatively, the Rokt WebView SDK can be added programmatically in your code. For example:
Swift
import RoktWebViewSDK
...
var roktWKWebView = RoktWKWebView(frame: self.view.frame)
Objective-C
#import <RoktWebViewSDK/RoktWebViewSDK-Swift.h>
...
RoktWKWebView *roktWKWebView = [[RoktWKWebView alloc] initWithFrame:self.view.frame];
To load a web page in the RoktWKWebView, use load() for Swift or loadRequest() for Objective-C.
Swift
roktWKWebView.load(URLRequest(url: URL(string: "https://www.rokt.com")!))
Objective-C
NSURL *nsurl=[NSURL URLWithString:@"https://www.rokt.com"];
NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
[roktWKWebView loadRequest:nsrequest];
- Download the source code locally
- Run the
RoktWebViewSDK.xcworkspace
project inExample
- Open
RoktWebViewSDK.podspec
and updates.version
to the new release version - Raise a PR targetting the latest
release-x.x
branch - After the build resolves, approve the
hold
job. This automatically runs thepublish
job which pushes your changes toCocoapods
Please see LICENSE