简体   繁体   中英

How to set a custom icon to an IOS push notification?

I'm currently adding notifications to my Flutter app for IOS, I wanted to add something similar to a largeIcon on Android, so far I didn't find a way to do that, only adding an image which is not a solution since I only want an icon at the right even if the user expands the notification (the image will expand too in this case which is undesirable for my use case).

As an alternative, I was wondering if I could change the notification app icon. As far as I looked around, this is not possible either, but at the same time I saw this image of notifications (the first one and the last one) that have a custom image and the app icon is smaller.

How can I do this in my app? I couldn't find any way in the documentation on how to do it.

在此处输入图像描述

You can do this with communication notifications. From HIG :

The system automatically displays a large version of your app icon at the leading edge of each notification; in a communication notification, the system displays the sender's contact image — or avatar — badged with a small version of your icon.

Here is the documentation on how to implement communication notifications in your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM