- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我们正在构建的 iPhone 应用程序中,我们使用推送通知负载中的 "content-available": 1
参数来调用 application:didReceiveRemoteNotification:fetchCompletionHandler:
一旦推送通知到达,就在应用程序委托(delegate)中。推送通知不是无声的;我们还使用“警报”和“声音”参数来通知用户。我已将 remote-notification
值添加到我的 Info.plist 文件中的 UIBackgroundModes
数组。
我注意到当我们使用开发 APNS 环境时,"content-available": 1
参数总是调用 application:didReceiveRemoteNotification:fetchCompletionHandler:
方法推送通知到达(gateway.sandbox.push.apple.com,这是我从 Xcode 运行应用程序时使用的)。不幸的是,当我通过 iTunes Connect 中的 TestFlight 分发应用程序时,情况并非如此(在这种情况下,正在使用生产 APNS 环境,gateway.push.apple.com)。在生产中调用 application:didReceiveRemoteNotification:fetchCompletionHandler:
是非常不可靠的,有时会被调用,有时不会,即使推送通知总是到达(当然我知道这一点,因为它不是不是隐藏通知,我会看到消息并听到声音)。
有没有人也有这样的经历? iOS 能否在生产环境中调用 application:didReceiveRemoteNotification:fetchCompletionHandler:
时更加“保守”,以尽量减少对电池生命周期的影响?
最佳答案
Apple 关心用户并确保应用程序不会耗尽设备的电池电量,尤其是在后台运行时。如果您的应用请求太多资源,系统可能会将您的应用请求推迟到优先级较低的队列。这是从文档中提取的
As soon as you finish processing the notification, you must call the block in the handler parameter or your app will be terminated. Your app has up to 30 seconds of wall-clock time to process the notification and call the specified completion handler block. In practice, you should call the handler block as soon as you are done processing the notification. The system tracks the elapsed time, power usage, and data costs for your app’s background downloads. Apps that use significant amounts of power when processing remote notifications may not always be woken up early to process future notifications.
还有第二个需要注意的时刻
However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.
关于ios - 使用 "content-available": 1 payload not always calling application:didReceiveRemoteNotification:fetchCompletionHandler: 推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29218840/
概述 我想实现一个 Lucene 索引器/搜索器,它使用新的有效负载功能,允许向文本添加元信息。在我的具体情况下,我向概念标签添加权重(可以理解为 % 概率,介于 0 到 100 之间),以便使用它们
我正在分析一个 metasploit 漏洞 here我试图弄清楚 payload.encoded 中的 payload 来自第 358 行。我是开发开发的新手,但基本的编程规则说 payload 应该
我从我的 javascript 发送交易 Metamask 打开传输对话框 我确定 i get an error message in metamask (inpage.js:1 MetaMask -
action.payload 何时、何地以及为什么被调用?请任何人帮助我了解action.payload的实际用途是什么。我已经搜索了很多网站,但我不明白.. 最佳答案 当您处理请求时,例如单击我们需
我用 Angular 编写代码,在一种情况下,json 返回一个值(如有效负载),我需要对其进行解密。我有一个这样的有效载荷: 我需要解码它。像下面的方式:例如,$B 部分的值我只需要 14,$s 的
我正在编写一个进行服务调用的 Chrome 扩展。 当我发出同源 POST ajax 请求时,我的数据对象以 JSON 格式传递: $.ajax(sameOriginURL, { data
如何在连接语句的 lambda 中访问信号的“有效负载”? 假设信号看起来像这样: signals: void stateChanged(std::pair); 现在在 connect 语句中,我
我正在尝试使用 RestSharp 来使用查询 rest,但我总是收到 Bad Request 响应。代码: var url = "https://gql.tokopedia.com/graphql/
在 Android GCM 文档中,据说有效载荷最大为 4096 字节限制。 payload的4096字节是否包括registration_id长度?我发现我可以发送有效载荷为 16038 字节(包括
前言 做过前后端联调的小伙伴,可能有时会遇到一些问题。例如,我明明传递数据给后端了,后端为什么说没收到呢?这时候可能就会就会有小伙伴陷入迷茫,本文从chrome-dev-tools(F12调试器)中看
我将 JSON 提供给某个网络钩子(Hook)以触发通知 (M$ Teams)。这很好用。但是,我想扩展我的 Perl 脚本:我需要在特定条件下向我的“messagecard”构造添加一个新节点。 例
我有一个 Xamarin 项目(UWP 和 iOS)在 VS2015 中构建并运行良好。 该项目包含一些通用 Windows 和 iOS 项目,以及两个平台使用的许多 PCL(用于 View 模型、服
我正在使用 Hyperledger Fabric Java SDK 通过 txId 获取交易。返回对象包含交易信息。 TransactionInfo txInfo = channel.queryTra
我有以下代码,用于检查 token 并授权 Google 用户登录 GoogleIdToken.Payload tempPayload = token.getPayload(); if (!tempP
当我们使用 sqlmap ,它会自动执行查找网站的 sql 注入(inject) 的所有操作。我感兴趣的是我直接在我的浏览器中发送恶意查询并在其中获取结果,但是当我找不到任何东西时,我使用 sqlma
我正在使用 Redux 和 React 从 API 加载数据。尽管成功提取数据并将其应用到状态,但它会抛出错误: Uncaught TypeError: Cannot read property 'p
我对 python 的随机函数有一个问题。我不知道哪个随机函数适用于此代码: name=['toffla','rebecca','toff','becca'] if (parser.getPayloa
在阅读了 Heartbeat 的 RFC 6520 后,我有几个问题: https://www.rfc-editor.org/rfc/rfc6520 具体来说,我不明白为什么心跳需要包含任意有效负载甚
如何用php curl发送请求负载? 我正在尝试将一个文件上传到一个免费托管文件的服务器,当将文件发送到curl时,我不接受它,我重定向到一个错误页,当我从您的interfas中执行此操作时,我可以在
我有一个非 ARC 项目,现在我在成功迁移后使用 SDK 8.1 迁移了应用程序 Xcode 6,当我尝试将其存档时,*.ipa 文件已创建,但如果我尝试通过上传应用程序diawi 或 hokey 应
我是一名优秀的程序员,十分优秀!