ios – Admob rewarded ad from SwiftUI

I am trying to make rewarded ad from Admob in my SwiftUI app but faced some problems. I am using official documentation that is written in obj-c and trying to make swift class from it.
Here what i have

final class Rewarded: NSObject, GADFullScreenContentDelegate {
    
    let token = Bundle.main.object(forInfoDictionaryKey: "GADApplicationIdentifier") as? String
    
    var rewardedAd = GADRewardedAd()
    
    var rewardFunction: (() -> Void)? = nil
    
    override init() {
        super.init()
        LoadRewarded()
    }
    
    func LoadRewarded() {
        let req = GADRequest()
        GADRewardedAd.load(withAdUnitID: token!, request: req, completionHandler: { gad, error in
            print(error)
        })
    }
    
    func showAd(rewardFunction: @escaping () -> Void){
        let root = UIApplication.shared.windows.first?.rootViewController
        do {
            try self.rewardedAd.canPresent(fromRootViewController: root!)
            self.rewardFunction = rewardFunction
            self.rewardedAd.present(fromRootViewController: root!, userDidEarnRewardHandler: rewardFunction)
        } catch let error {
            print(error)
        }
    }
    
    func rewardedAd(_ rewardedAd: GADRewardedAd, userDidEarn reward: GADAdReward) {
        if let rf = rewardFunction {
            rf()
        }
    }
    
    func rewardedAdDidDismiss(_ rewardedAd: GADRewardedAd) {
        self.rewardedAd = GADRewardedAd()
        LoadRewarded()
    }
}

In method showAd i have an exception nilerror from invocation of try self.rewardedAd.canPresent(fromRootViewController: root!) and have no idea what to do with that. I didn’t find any tutorial that shows how to set up it with version of sdk 8+, can you please help me to figure out what is the problem.