没有在iOS 8元件X code静音问题的通知 [英] Silent Notification Issues without Xcode on iOS 8 Devices

查看:141
本文介绍了没有在iOS 8元件X code静音问题的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试了沉默的通知功能是可用的iOS以来7。

I've been testing out the Silent Notification feature that is available since iOS 7.

我的应用程序是针对iOS 7及以上。

My application is targeting iOS 7 and UP.

我测试的iPhone6​​设备上。

I'm testing on an iPhone6 device.

似乎一切都在我的应用程序工作的伟大的,当我的iPhone连接到电脑和放大器; X code为运行应用程序。所有无声的通知的工作100%,他们在我的应用程序显示为好。

Everything seems to work great in my application when my iPhone is connected to the computer & Xcode is running the application. All silent notifications work 100% and they show up in my application as well.

不过,如果我停止X code&放;发送一个无声的通知 - 我的设备根本不接受沉默的通知。

However, if I stop Xcode & send a silent notification -- my device does not receive the silent notifications at all.

我已经做了研究,但没有很多给我一个答案,也帮助我确定是怎么回事。

I have done a LOT of research but nothing has given me an answer nor has helped me determine what is going on.

我没有杀了我的申请。所以,这不是问题。你仍然可以看到在应用程序切换器中的应用。

I have not killed my application. So, that is not the issue. You can still see the application in the app switcher.

我的应用程序定期收到推送通知(带和不带X code)。问题是无症状通知。

My application does receive regular push notifications (with and without Xcode). The issue is with Silent Notifications.

找到了这些(但他们没有帮我解决这个问题):

Found these (but they did not help me solve the issue):


  1. IOS不工作8无声推送通知没有X code

  2. iOS当连接到X code
  3. 无声推送通知仅适用
  1. IOS 8 Silent push notification not working without Xcode
  2. iOS silent push notification only works when connected to xcode

我已经加入了优先级的标签,以我的JSON有效载荷,以及...仍然没有运气。

I have added the "Priority" tag to my JSON payload as well... and still no luck.

这是我的有效载荷:

$体['APS'] =阵列(
    内容可用'=> 1,
    '警报'=> $消息,
    '优先'=> 10,
    声音= GT; '默认'
);

我甚至尝试了优先权所有较低套管,。

I've even tried "priority" all lower-cased.

我的手机确实得到警报,它发出的声音。但是,如果用户选择应用程序图标,而不是打着警报 - 它不会沉默的通知。这仅发生在我的应用程序未连接,并且根据X code运行。

My phone does get the alert and it makes the sound. But, if a user selects the "app icon" instead of the banner alert -- it doesn't get the silent notification. This only happens when my application isn't connected and running from Xcode.

另外,我使用的是开发者证书,并发放模板。

Also, I am using a Developer certificate and Provisioning Profile.

更新1:

发现,优先级设置应该是除了二进制通知不APNS有效载荷。

Found out that the Priority setting is supposed to be apart of the binary notification not the APNS Payload.

我从负载删除优先级,并配置二进制通知,命令2

I removed "priority" from payload and configured binary notification as Command 2.

请参阅:<一href=\"https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html\" rel=\"nofollow\">https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html

以X code测试。一切正常。经测试没有X code。还是同样的问题。 =(

Tested with Xcode. Everything works. Tested without Xcode. Still same issue. =(

更新2

我测试了一个iPhone 4设备的应用程序。静音通知带或不带它x code工件。因此,这必须是一个严格的问题与iOS 8台设备。

I tested the application on an iPhone 4 Device. Silent Notifications work with or without Xcode on it. So, this must be an issue strictly with iOS 8 devices.

更新标题来反映的iOS 8.我不知道如何解决这个问题适用于iOS设备8。任何人有什么建议吗?

Updating title to reflect only iOS 8. I'm not sure how to fix this for iOS 8 devices. Anyone have any suggestions?

推荐答案

好吧,我终于解决了,为什么沉默的通知并没有在iOS 8台设备的工作。

Okay, so I finally solved why the silent notification wasn't working on iOS 8 devices.

在你从PHP脚本发送二进制通知,必须优先设置为5,当你没有运行在X code本的应用程序将无法与10工作。

In the binary notification that you send from the PHP script, the priority must be set to 5. It will not work with a 10 when you are not running your application from Xcode.

我不知道为什么应用程序与10根据X code运行时的工作 - 这就是为什么它是如此难以确定什么是错的。我也不知道为什么10优先工作的iOS 7的设备。

I don't know why the application worked with a 10 when running from Xcode -- this is why it was so hard to determine what was wrong. I also don't know why a priority of 10 worked for iOS 7 devices.

请参阅:<一href=\"https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html\" rel=\"nofollow\">https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html

这篇关于没有在iOS 8元件X code静音问题的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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