Push Notifications without alert

前端 未结 6 1848
名媛妹妹
名媛妹妹 2021-01-01 04:56

Can I get push notifications without alert view? The idea in what service for game will send notifications as response for change game state (may be game state will store in

6条回答
  •  生来不讨喜
    2021-01-01 05:42

    No, a push notification will always display a notification as it requires user consent to wake up or launch your application. However if your Application is in the foreground and running, the push notification will not appear and your app can handle the message that the push notification has. All of the preceding applies to local notifications aswhile.

    I don't know what you mean by game state. But just have your app listen in on a script on your server which will pass information to your app. Edit: Or like I said above if your app is open in the foreground, push notifications won't appear on screen and you can send information that way. However if you want to do it in the background its not possible no matter what unless you are truly multitasking (GPS, VOIP, Music) or you have user consent through push notification.

提交回复
热议问题