如何弹出系统“请求通知访问”窗口的Android与离子电容器?
PushNotifications.requestPermissions()
的文档称**“android always receive notification”(安卓始终接收通知),这是错误的**。某些品牌(如三星)或用户可以默认禁用它们。
**
* Request permission to receive push notifications.
*
* On Android it doesn't prompt for permission because you can always
* receive push notifications.
*
* On iOS, the first time you use the function, it will prompt the user
* for push notification permission and return granted or denied based
* on the user selection. On following calls it will get the current status of
* the permission without prompting again.
*
* @since 1.0.0
*/
requestPermissions(): Promise<PermissionStatus>;
还将此添加到AndroidManifest.xml,但没有任何内容。
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
1条答案
按热度按时间2j4z5cfb1#
文档显示和示例:
https://capacitorjs.com/docs/apis/push-notifications