Check out example codes for "swift open url". It will help you in understanding the concepts better.

Code Example 1

guard let url = URL(string: "http://www.google.com") else {
  return //be safe
}

if #available(iOS 10.0, *) {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
    UIApplication.shared.openURL(url)
}

Learn ReactJs, React Native from akashmittal.com