How to customize short preview of notifications in iOS 10+

前端 未结 2 1657
忘了有多久
忘了有多久 2021-01-20 19:04

I have implemented iOS rich notifications in my app based on Local and Remote Notification Programming Guide.

I watched WWDC Introduction to Notifications, Advanced

相关标签:
2条回答
  • 2021-01-20 19:25

    I just stumbled upon the following line in the Customizing the Appearance of Notifications article in the official documentation:

    The system provides the interface for the abbreviated banner, but you can customize the full interface using a notification content app extension.

    This confirms that currently there is no way of customizing the short preview ("abbreviated banner" in the docs).

    0 讨论(0)
  • 2021-01-20 19:31

    I think (I'm not 100% sure) that you can only display an Attachment Image in the Notification banner, because you don't have Storyboad or UI file for this. It is the default Notification banner design.

    You can follow this great guide (links below), it helps me understand Notification Content Extension and Notification Service Extension and all the logic behind and how it really works.

    You can try to make some adjustments to the project, trying with anything else than ImageView, but as far as I know, the attachment is by default positioned at the right corner, as a miniature.

    I am interested if you find additional informations.

    Here is the great links that helped me build my Notification Feature in my App.

    Sources:

    Rich Notification Guide

    Notification with Attachment

    PS: I am also sad and disapointed that the expended view only appears with 3D Touch (People don't use it, 3D Touch is a failure to me).

    0 讨论(0)
提交回复
热议问题