美文网首页
2018-02-23笔记

2018-02-23笔记

作者: __Seven | 来源:发表于2018-02-23 15:56 被阅读1次

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

    主要针对下面三种模式:

         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);// 允许在前台展示消息,不设置的话,默认是不行的}
    

    相关文章

      网友评论

          本文标题:2018-02-23笔记

          本文链接:https://www.haomeiwen.com/subject/pxyxxftx.html