2018-02-23笔记

2018-02-23  本文已影响1人  __Seven

修改本地调试,可以选择进入、撤销、查看、直接回复。

主要针对下面三种模式:

     UNNotificationAction:

     UNNotificationActionOptionAuthenticationRequired,
     UNNotificationActionOptionDestructive,
     UNNotificationActionOptionForeground。

直接会弹起键盘的通知:

      UNTextInputNotificationAction *inputAction = [UNTextInputNotificationAction actionWithIdentifier:@"sevenAction.input" title:@"输入" options:UNNotificationActionOptionForeground textInputButtonTitle:@"发送" textInputPlaceholder:@"tell me messege"];

通知弹起的的代理处理:

 - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response withCompletionHandler:(nonnull void (^)())completionHandler { //省略1W行代码}

允许在前台展示推送:

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler  { completionHandler 
      (UNNotificationPresentationOptionAlert|UNNotificationPresentationOptionSound);// 允许在前台展示消息,不设置的话,默认是不行的}
上一篇下一篇

猜你喜欢

热点阅读