简体   繁体   中英

Can i customise push notification appearance in iOS?

I can't seems to find and control over push notification appearance. Is it so, or i am just missing something.

Have a look at the following image

通知窗口屏幕截图

what i actually want to achieve is to put NSTextAttachment in these notification texts.

As far as of now, i have gathered that this is something which can not be achieved because we don't have control over how iOS displays Push Notifications.

But i just want to be absolutely sure about this.

iOS will parse notification payload for "Alert", "Badge", "Sound" & "Content-Available" and as if it got these param, it will show up the notification and ignore remaining parameters.

You can add up other parameters in payload, but that you can use in your app only not in notification tray ie you can not manipulate or say customise/style push notification view in notification tray because iOS do not allow to do so.

Interactive Notifications: you can add action buttons or textfield to your notification those iOS have provided provision for, but as i said above, you cannot customise/style push notification .

CONCLUSION: which specifically in your case, you cannot add NSTextAttachment.

According to this you article you can change it, I am not sure Apple added this provision recently or it existed before this post https://developer.apple.com/documentation/usernotificationsui/customizing_the_appearance_of_notifications?language=objc 在此处输入图片说明

Cannot be done. iOS only lets you supply the content, not the style

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