Templates Plugins Courses

New ios container version


Hello. I ve downloaded the new version of zeroqode. On the last version i used some custom code to get the player id from onesignal. The code was in appdelegate and viewcontroller, On this version where i can add some custom code cause you dont have viewcontroller. Thanks



You can still use the ViewController. Create a new one like this:

class ViewController: SuperWebViewController {
    override func viewDidLoad() {
        guard let userID = OneSignal.getPermissionSubscriptionState()?.subscriptionStatus.userId else {
            print("No OneSignal User ID")
        print("OneSignal UserID: \(userID)")

And in AppDelegate.swift file, didFinishLaunchingWithOptions method, bellow SuperView.configure call add this:

self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = ViewController()