         // completionHandler([])
     }
     
-    
-    
     func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
-        let category = response.notification.request.content.categoryIdentifier
-        if category == UserNotificationCategoryType.birthday {
+        // let category = response.notification.request.content.categoryIdentifier
+        let action = response.actionIdentifier
+        if action == UNNotificationDismissActionIdentifier {
+            // dismissed, do nothing
+        } else if action == BirthdayActionType.happy || action == BirthdayActionType.cancel {
             handleBirthdayAction(response: response)
+        } else if action == UNNotificationDefaultActionIdentifier {
             openSpecificPageBy(response: response)
         }
-        
         completionHandler()
     }
     

        self.registerNotificationCategory()
    }
    
    
    struct UserNotificationCategoryType {
        static let birthday = "birthdayCategory"
    }
    
    struct BirthdayActionType {
        static let happp = "action.happyBirthday"
        static let cancel = "action.cancel"
    }
    
    
    func userNotificationCenter(_ center: UNUserNotificationCenter,
                                willPresent notification: UNNotification,

            
            // 2
            let happyBirthdayAction = UNNotificationAction(
                identifier: BirthdayActionType.happy,
                title: NSLocalizedString("生日快乐!!", comment: ""),
                options: [.foreground])
            
