         
         UNUserNotificationCenter.current().setNotificationCategories([birthdayCategory])
     }
+    
 }

        // completionHandler([])
    }
    
    
    
    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
        let category = response.notification.request.content.categoryIdentifier
        if category == UserNotificationCategoryType.birthday {
            handleBirthdayAction(response: response)
            openSpecificPageBy(response: response)
        }
        
        completionHandler()
    }
    

    
    private func handleBirthdayAction(response: UNNotificationResponse) {        
        let actionType = response.actionIdentifier
        if actionType == BirthdayActionType.happy {
            let charName = response.notification.request.content.userInfo["charName"]! as! String
            let reply = NSLocalizedString("%@收到了你的祝福", comment: "")
            let message = String.init(format: reply, charName)
            
            openSpecificPageBy(response: response)
            // 延时2秒, 同时进行会导致无法弹出角色详情页面
            DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {
                UIAlertController.showConfirmAlertFromTopViewController(message: message)
            })
            
        } else if actionType == BirthdayActionType.cancel {
            // do nothing
        }
    }
    
    private func registerNotificationCategory() {
        let birthdayCategory: UNNotificationCategory = {
