Swift didReceivePush notification is not showing navbar buttons

Viewed 8

I have push notifications that come in from firebase. However when I click the push notification the proper screen does get pushed but the navbar items on that screen are hidden. The functionality is there but the text is just not being show. Any help would be appreciated.

l

et data = response.notification.request.content.userInfo
        guard var rootViewController = (UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate)?.window?.rootViewController else {
            return
        }
        
        let hud = MBProgressHUD.showAdded(to: rootViewController.view, animated: true)
        hud.mode = .indeterminate
        
        self.root = rootViewController as? UINavigationController
        
        
        rootViewController = UIViewController()
        let mainStoryboardIpad: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let documentViewController = mainStoryboardIpad.instantiateViewController(withIdentifier: "DocumentViewController") as! DocumentPDFViewController
    
        documentViewController.documentItem = DocumentItemModel(DocumentKey: data["documentKey"] as! String,
                                                                DocumentUrl: data["url"] as! String,
                                                                BranchId: 0,
                                                                BranchName: data["branchName"] as! String,
                                                                PeriodType: "",
                                                                ReportId: 0,
                                                                ReportName: data["reportName"] as! String,
                                                                DateTitle: data["dateTitle"] as! String,
                                                                FinancialPeriodId: 0,
                                                                hasOpened: true)
        
        
        self.root!.pushViewController(documentViewController, animated: true)
        hud.hide(animated: true)

Here is a picture below, clicking on the share button activates usual functionality but when this view is called from the push notification. When its tapped. The Navbar items just don't show text at all. However they are there when the app is flowing originally.

Any suggestions or help is hugely appreciated. Just even a point in the right direction is all I need.

enter image description here

0 Answers
Related