你可以从App一侧的无声的传入推送通知[iOS版] [英] Can you mute incoming Push Notifications from the App side [iOS]

查看:222
本文介绍了你可以从App一侧的无声的传入推送通知[iOS版]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用苹果推送通知的应用程序。我希望能有一个下班的模式,其中的推送通知仍然收到,但没有播放声音时,它的用武之地。有没有办法从内部应用程序静音这些推送通知?我知道我根本无法从JSON发送消息的声音,但它会更容易,如果我可以从应用程序内做到这一点。我想仍然收到通知,所以我不希望从推送通知注销

I am making an app that uses Apples Push Notifications. I want to be able to have an "off duty" mode, in which the push notification is still received, but no sound is played when it comes in. Is there a way to mute these push notifications from inside the app? I know I can simply not send the sound from the JSON message, but it would be easier if I could do it from inside the app. I want to still receive the notifications, so I don't want to unregister from push notifications

推荐答案

如果您的应用程序在后台,只有这样,才能静音推不从JS​​ON消息发送的声音。

If your app is in background, the only way to mute the push is not send the sound from the JSON message.

当你的应用程序是前台,您将通过应用程序接收推送:didReceiveRemoteNotification :,在这种情况下,无论你发出声与否,应用会悄悄地接收推送。

When your app is foreground, you will receive push by application:didReceiveRemoteNotification:, in this case, whether your send sound or not, app will receive push silently.

这篇关于你可以从App一侧的无声的传入推送通知[iOS版]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆