IOS远程无声通知中的电话/网络波动不工作 [英] IOS remote silent notification is not working during phone calls / network fluctuation

查看:171
本文介绍了IOS远程无声通知中的电话/网络波动不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发iOS的应用程序,其中我做的工作背景。我通过发送无声通知觉醒的应用程序。在code工作正常的大部分时间。

I am developing the iOS application where I am doing the background work. I am awaking the app by sending the silent notification. The code is working fine most of the time.

问题是在通话过程中的应用程序不会醒来,即使是在低网络连接或网络应用的波动过程中不会醒来。

The issue is during the phone call app is not awaking, even during the low network connectivity or during network fluctuation app is not awaking.

我做下面的事情:

1: Enabled 2 background mode
   i) Background fetch.
   ii)Remote notification. 

2: Sending notification as:

   { 
  aps: {
          content-available: 1,
          sound: ""
          message:"background fetch"
       }
    } 

and 
3)
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
     UALogFull(@"\n\n BACKGROUND NOTIFICATION \n\n\n");
     completionHandler(UIBackgroundFetchResultNewData);

}

我的观察是:
该应用程序是不是崩溃。
它在通话过程中不记录BACKGROUND通知即使有通知(移动终端连接WIFI)。

My observation is: The app is not crashing. It is not logging "BACKGROUND NOTIFICATION" even there notification during the phone call( the mobile is connected wifi ).

请让我知道我怎样才能得到的准确度?

Please let me know how I can get the accuracy?

推荐答案

我相信,只是因为你要发送一个无声的通知,并不意味着该应用程序将得到马上通知。

I believe just because you are sending a silent notification, doesn't mean that the application will get notified straight away.

从使用GSM iPhone我的观察。每当我在一个电话蜂窝数据类型滴带如LTE - > 3G,3G - >边等,所以该数据网络是不可靠的

From my observations using a GSM iPhone. Whenever I am on a Phone Call the Cellular Data type drops a band e.g. LTE -> 3G, 3G -> EDGE etc. So the data network is not reliable.

您还指出,它不网络波动时发生,该系统已经收到该通知时,它并没有沿节省电池的目的通过了它。较慢的蜂窝数据连接,电池上的多排

You also state that it does not happen during network fluctuation, the system has recieved the notification, it hasn't passed it along for battery saving purposes. The slower the cellular data connection is, the more draining on the battery.

在无线网络上关于一个phonecall,仍然没有recieving沉默的通知。蜂窝芯片上运行,使用的WiFi,以及将更多的电池电量的消耗。

In regards to a phonecall on wifi, still not recieving the silent notification. The cellular chip is running, using the wifi as well would drain the battery even more.

从我的理解无声的通知是为了让设备知道有新的数据可用。因为窗口到下载所述的背景数据是一个小窗口,可能存在某些情况下,这是不恰当与正在描述本质上是原因的实施例。

From my understanding a silent notification is to let the device know that there is new data available. Because the window to download said data in the background is a small window, there may be certain cases where it is not appropriate with the examples you are describing essentially being the reasons.

在一个电话呼叫 - >蜂窝芯片被用于语音传输。数据传输是芯片做可能会影响电池寿命显着额外的工作。

On a phone call -> The cellular chip is being used for voice transmission. Data transmission is extra work for the chip to do which could affect battery life dramatically.

电网波动 - >系统无法保证连接牢固,允许被下载的数据。此外,在较慢的数据传输速度面积为是试图找到一个更强大,更稳定的连接带蜂窝芯片上的额外负担。

Network Fluctuation -> The system cannot guarantee a solid connection allowing for data to be downloaded. Also being in a slower data speed area is additional strain on the cellular chip that is trying to locate a stronger, more stable connection band.

一个无声的通知让您的应用程序,以present新的数据用户为造福于用户,当他们切换到您的应用程序,他们不必等待新的内容一样长。但它不是应用功能的重要组成部分。该系统还将确定是否沿基于其他因素,如自去年推出的时间通过您的通知。关闭应用程序后,关闭或很​​长一段时间后,太快可能意味着你的应用程序不会得到优先处理,必须等待其他应用程序,

A silent notification allows your app to present fresh data to the user as a benefit to the user when they switch back to your app, they don't have to wait for fresh content for as long. But it is not an essential part of app functionality. The system will also determine whether to pass your notification along based on other factors, such as time since last launch. Too soon after closing or a long time after closing the app might mean that your app won't get priority and will have to wait for other apps,

太快:内容还是比较新鲜的。
很长一段时间:用户不使用应用程序很多。节省资源。

too soon: content is still relatively fresh. long time: The user is not using the app a lot. Save resources.

此模式推出混合英寸如果你沿着当用户更有可能基于previous模式来启动应用程序时发送通知,你更有可能收到通知。

Mix in with this launch patterns. If you send the notification along at a time when the user is more likely to launch your app based on previous patterns, you are more likely to recieve the notification.

最后引用文档:

重要提示:通知交付是尽力而为,不能保证。它并非旨在传递数据到应用程式,只通知用户有新的数据可用。

Important: Delivery of notifications is a "best effort", not guaranteed. It is not intended to deliver data to your app, only to notify the user that there is new data available.

<一个href=\"https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW1\"相对=nofollow>在这里找到

这篇关于IOS远程无声通知中的电话/网络波动不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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