IOS远程静音通知在电话/网络波动期间不起作用 [英] IOS remote silent notification is not working during phone calls / network fluctuation

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

问题描述

我正在开发 iOS 应用程序,我正在做后台工作.我通过发送静默通知来唤醒应用程序.代码大部分时间都运行良好.

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);

}

我的观察是:该应用程序没有崩溃.即使在通话期间有通知(手机已连接 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 -> EDGE 等等,所以数据网络不可靠.

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.

关于 wifi 上的电话,仍然没有收到静默通知.蜂窝芯片正在运行,同时使用 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.

静默通知允许您的应用向用户呈现新鲜数据,以便在用户切换回您的应用时为用户带来好处,他们不必等待新内容太久.但它不是应用程序功能的重要组成部分.系统还将根据其他因素(例如自上次启动以来的时间)确定是否传递您的通知.关闭应用程序后过快或关闭应用程序很长时间可能意味着您的应用程序将无法获得优先权,而必须等待其他应用程序,

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.

与此启动模式混合.如果您在用户更有可能根据之前的模式启动您的应用时发送通知,您就更有可能收到通知.

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.

在这里找到

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

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