没有警报iPhone推送通知 [英] iPhone push notification without alert

查看:186
本文介绍了没有警报iPhone推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能到一个文本推送通知发送到一个iPhone应用程序没有它弹出一个模式对话框?我希望它直奔盘,就像一个Android通知。我知道这个通知栏可以非常类似于美元,iPhone p $ psent通知到Android,但我的研究告诉我,只有这样,才能得到一个有先有它弹出一个模式!

Is it possible to send a text push notification to an iPhone app without it popping up a modal dialog? I want it to go straight to the tray, like an Android notification. I know the notification tray can present notifications on iPhone very similarly to Android, but my research tells me the only way to get one there is to first have it pop up as a modal!

我创建一个聊天应用程序,一个模式对话框每次其他人发送消息(可以是每秒)将是非常恼人的弹出,但我需要让用户以某种方式知道有新消息。我不认为只是递增的徽章数量足够的,因为应用程序可能无法在主页屏幕上,他们会看到它,并提供没有迹象表明,如果手机被锁定(据我所知)。我实际上没有一个iPhone,我从来没有用的,所以也许我的路要走关于用户期待什么iPhone基地。

I'm creating a chat app, and a modal dialog popping up every time other people send messages (which could be every second) would be extremely annoying, but I need to have some way of letting the user know there are new messages. I don't think just incrementing the badge number is enough, since the app might not be on the home screen where they'll see it, and that provides no indication if the phone is locked (as far as I know). I don't actually have an iPhone and I've never used one, so maybe I'm way off base about what iPhone users expect.

推荐答案

如果您使用APNS JSON,你可以简单地发送空的身体,并没有将psented用户$ P $。您可以发送隐藏字段中,为您的应用程序的目的。

If you use APNS JSON, you can simply send null as body, and nothing will be presented to user. You can send "hidden" field, for your app purposes.

或者只设置最preferred UIRemoteNotificationType(的iOS 7)或UIUserNotificationSettings(iOS版8)的通知。

Or just set most preferred UIRemoteNotificationType (iOS 7) or UIUserNotificationSettings (iOS 8) for your notifications.

这篇关于没有警报iPhone推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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