notifications.registerForPushNotifications()

类型 函数
返回值
修订 版本 2024.3703
关键词 notification, notifications, registerForPushNotifications
另请参阅 本地/推送通知 (指南)
notifications.scheduleNotification()
notifications.*

概述

在 iOS 上注册推送通知。这将显示一个弹出窗口,询问用户是否要启用推送通知。第一次调用后,后续调用将不再显示该弹出窗口。

注意事项

此函数在 Android 上无效。

语法

notifications.registerForPushNotifications()

示例

local notifications = require( "plugin.notifications" )

notifications.registerForPushNotifications()