Hi everyone!
Im really new to programming and im trying to build my first "app". It is just app what opens webpage (company store) and it works fine. But in signin page there is links to login with facebook account and those links doesnt work. I have googled my *** off and havent found solution. Maybe you guys could help me figure out what needs to be done to get it working? My viewcontroller.swift looks like this:
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
var webView: WKWebView?
override func prefersStatusBarHidden() -> Bool {
return true
}
/ Start the network activity indicator when the web view is loading */
func webView(webView: WKWebView,
didStartProvisionalNavigation navigation: WKNavigation){
UIApplication.sharedApplication().networkActivityIndicatorVisible = true
}
/ Stop the network activity indicator when the loading finishes */
func webView(webView: WKWebView,
didFinishNavigation navigation: WKNavigation){
UIApplication.sharedApplication().networkActivityIndicatorVisible = false
}
override func viewDidLoad() {
super.viewDidLoad()
/ Create our preferences on how the web page should be loaded */
let preferences = WKPreferences()
preferences.javaScriptEnabled = true
/ Create a configuration for our preferences */
let configuration = WKWebViewConfiguration()
configuration.preferences = preferences
/ Now instantiate the web view */
webView = WKWebView(frame: view.bounds, configuration: configuration)
if let theWebView = webView{
/ Load a web page into our web view */
let url = NSURL(string: "https://www.companypage.com")
let urlRequest = NSURLRequest(URL: url!)
theWebView.loadRequest(urlRequest)
theWebView.navigationDelegate = self
view.addSubview(theWebView)
}
}
}