Firebase iOS推送通知委托方法

Firebase iOS推送通知委托方法,ios,objective-c,firebase,push-notification,Ios,Objective C,Firebase,Push Notification,我第一次做推送通知。我正在使用Firebase进行此操作。 我现在只处理应用程序处于活动状态时的推送通知。在没有firebase的情况下,为处理传入通知及其点击而调用的委托方法如下(iOS 10): 现在,来到Firebase,我有以下方法来显示传入消息 - (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage { NSLog(@"%@", remoteMessage.app

我第一次做推送通知。我正在使用Firebase进行此操作。 我现在只处理应用程序处于活动状态时的推送通知。在没有firebase的情况下,为处理传入通知及其点击而调用的委托方法如下(iOS 10):

现在,来到Firebase,我有以下方法来显示传入消息

- (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage  {

    NSLog(@"%@", remoteMessage.appData);
    [TSMessage showNotificationWithTitle:[remoteMessage.appData objectForKey:@"message_title"]
                                subtitle:[remoteMessage.appData objectForKey:@"message_body"]
                                    type:TSMessageNotificationTypeMessage];
}
问题: 1) 上述Firebase方法没有使用completionHandler(UNNotificationPresentationOptionAlert)的完成处理程序


2) 在Firebase的情况下如何处理点击通知?

在给定的示例代码中,我可以理解您在收到通知时会显示警报。用户与此警报交互时,为什么不执行操作?这是第三方库。我想避免使用它。另外,对于iOS 10,苹果已经提供了使用completionHandler(UNNotificationPresentationOptionAlert)的选项,但我不确定如何将其与firebase一起使用。-(void)userNotificationCenter:(UNUserNotificationCenter*)center将显示通知:(UNNotification*)通知completionHandler:(void(^)(UNNotificationPresentationOptions)completionHandler当您收到通知时是否调用此方法?您是发送数据消息还是通知消息?@chengsam..是数据消息!
- (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage  {

    NSLog(@"%@", remoteMessage.appData);
    [TSMessage showNotificationWithTitle:[remoteMessage.appData objectForKey:@"message_title"]
                                subtitle:[remoteMessage.appData objectForKey:@"message_body"]
                                    type:TSMessageNotificationTypeMessage];
}