//
//  OptOutVC.swift
//  Simple-PlayerStandard-Swift-SDK_6.1.0.1
//
//  Created by Abdul on 30/08/18.
//  Copyright © 2018 Abdul. All rights reserved.
//

import UIKit
import WebKit
import NielsenAppApi

class OptOutVC: UIViewController, NielsenAppApiDelegate, WKNavigationDelegate {
    
    var webView: WKWebView!
    var nielsenApi: NielsenAppApi!
    var optOutURL: String!
    
    override func loadView() {
        webView = WKWebView()
        webView.navigationDelegate = self
        view = webView
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
            
  //      self.view.backgroundColor = UIColor(patternImage: UIImage(named: "new_ios_bg.png")!)
        if let url = URL(string: optOutURL) {
            webView.load(URLRequest(url: url))
            webView.allowsBackForwardNavigationGestures = true
        }
//        self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)
//
//        if let appApi = self.nielsenApi {
//            //Getting the optPut URL from SDK
//            if let url = URL(string: appApi.optOutURL) {
//                webView.load(URLRequest(url: url))
//                webView.allowsBackForwardNavigationGestures = true
//            }
//        }
    }
    
}

