我是否仍需要注册远程通知才能在我的应用中启用静音通知? [英] Do I still need to register for Remote Notifications to enable Silent Notifications in my app?

查看:156
本文介绍了我是否仍需要注册远程通知才能在我的应用中启用静音通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向用户发送无声通知(在后台接收 - 不提醒,声音或徽章)。
我在Xcode的后台模式中检查了远程通知选项。

I want to send silent notifications to my users (receive in background - not alert, sound or badge). I checked the Remote Notifications option in Xcode's Background Modes.

我的问题是 - 我还需要使用注册远程通知吗? [UIApplication sharedApplication] registerForRemoteNotificationTypes
如果是这样 - 我应该使用什么类型?它们都不像无声通知:

My question is - do I still need to register for remote notifications using [UIApplication sharedApplication] registerForRemoteNotificationTypes? If so - what type should I use? None of them looks like "Silent Notifications":


  • UIRemoteNotificationTypeNone

  • UIRemoteNotificationTypeBadge

  • UIRemoteNotificationTypeSound

  • UIRemoteNotificationTypeAlert

  • UIRemoteNotificationTypeNewsstandContentAvailability

  • UIRemoteNotificationTypeNone
  • UIRemoteNotificationTypeBadge
  • UIRemoteNotificationTypeSound
  • UIRemoteNotificationTypeAlert
  • UIRemoteNotificationTypeNewsstandContentAvailability

这样做的正确方法是什么?

What is the correct way to do this?

推荐答案

雅你能做到:

但请您的后端开发人员发送通知,如下面的空声音文件:

But ask your backend developer to sent notification like following empty sound file:

{
"aps" : {
     "sound" : "nothiong.cif"
}
}

它将显示没有声音的通知。

It will display notification without sound.

注意:声音文件不能在App包中。

Note: The sound file not must in App bundle.

这篇关于我是否仍需要注册远程通知才能在我的应用中启用静音通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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