Is it possible to have a custom dialog message when asking for notification permissions?

前端 未结 4 811
孤独总比滥情好
孤独总比滥情好 2020-12-15 09:17

I would like to customize the following part of the notification permission prompt:

Notifications may include alerts, sounds, and icon ba

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 10:08

    I do not believe you can change the iOS prompt, but should maybe make your own. See the guidelines that Apple has provided:

    https://developer.apple.com/ios/human-interface-guidelines/interaction/requesting-permission/

    Not the best resource because it does state that you can change the subtext (this is specifically for location, photos, etc.) but this, and others, have some good practices:

    https://blog.clevertap.com/asking-for-ios-push-notification-permissions/

    Basically, you should make your own prompt. Be sure to handle the cases where they have either said no, or turned it off in settings and redirect the user to settings, if so.

提交回复
热议问题