手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表Tag:xen

apns 二三事

今天要說的還是推送,NND,這個推送這玩意,折騰死人
1、aps中是否只能有badge/alert/sound等參數?
答:不是,這個只是最基本的參數,可以有很多參數,但aps標記需要一定存在,其他參數可以自定義,比如:

JavaScript代码
  1. {  
  2.     "aps" : {  
  3.     },  
  4.     "acme2" : [ 5,  8 ]  
  5. }  

aps参数可以是空,但一定要有,上面这个可不是我杜撰的,这是官方的例子:http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW12

2、aps中的content-available是什么意思
答:这个是有特殊需要的时候才需要用,比如用来后台下载?说实话,我在官方没找到文档,反而在adobe找到一个小的介绍 :
第一个介绍:http://www.adobe.com/devnet/digitalpublishingsuite/articles/dps-push-notification.html

Table 3. Parameters for APNS messages

Property value description
alert <string> The text message to display to the user. No localization arguments are supported.
badge <number> If non-zero, it displays the number on the icon of the application. If zero, no number is displayed.
content-available 0 | 1 Non-zero indicates a Newsstand push message. The receipt of this will wake the viewer to begin a background download. See Notes.
sound "default" Only the default notification sound is supported.
productID <string> Product.

Notes about Newsstand background downloading

  1. Background downloads are limited to once every 24 hours, +/- 1 hour (or so). You can send as many alert messages you like, but only background downloading will be throttled.
  2. Background downloading will only happen over WiFi connections. If the user is on 3G and the push is received, the background download is lost.
  3. A valid subscription via Apple or direct entitlement (CDS, TCS, PCD, Dovetail, or other) must exist.
  4. Only the most recent folio will be background-downloaded. The user must be entitled to this content.
  5. Apple attempts a number of times to deliver the push payload. As such, the actual download may begin a significant amount of time after it was originally sent or scheduled.

用了content-available参数后,下一次接收一定是在24小时后。看上面的notes

还有一个介绍在这里:http://www.viggiosoft.com/blog/blog/2011/10/17/ios-newsstand-tutorial/,这篇博客很详细,还告诉你在APP中怎么设置,内容过长,我就不一一贴出来了。
它这么说:
The push notification message has the same syntax as standard push notifications with the only difference that the payload must contain the content-available key set to 1:

JavaScript代码
  1. {  
  2.   "aps":{  
  3.     "content-available":1,  
  4.         },  
  5.    "device_tokens": ["E9623F5CFDE92B40DA4AA90B97B70428BCD8FFCBA067BE17A6EF5102651E66E9"]  
  6. }  

There is one importation limitation related to the frequency of pushes: to limit the consumption of resources due to background downloading (which, by the way, we’ll happen only if the device is connected to a Wi-Fi network) Newsstand push notifications are coalesced and only one background download is permitted per day. For testing purposes you can remove this limit by setting an appropriate key in the user defaults (do this at startup in your App Delegate)
大小: 96.37 K
尺寸: 251 x 376
浏览: 1993 次
点击打开新窗口浏览全图

Tags: apns, apple

杂谈吧

或许很多人在看到我博客的上面微勃图片的时候肯定很吃惊:求财付通0.5元支付宝返还。

事实上,在发出这条消息的时候,虫少侠(http://www.enjoyphp.com/)就在财付通上给我了,当然,我立马从支付宝返还了,还的当然不止0.5元。

这是上周日我在测试财付通支付的时候因为没钱也不愿意绑定号码的时候遇到的问题,所幸还是有朋友愿意提供了钱,而不是让别人误会我在诈骗。。。

------------------------------------------------------------------

第二个就是http://codeany.com/,这是一个基于PHPRPC的内容分析的接口,用网站上的介绍来说就是:在Codeany在线接口的帮助下,引入站内检索,正文提取,热词提取和SEO优化,智能垃圾评论判定等服务,就跟在饮料机上接一杯饮料一样简单.立即可用,无需开发!

当然我不能这样见解,准备好好看看htmlSQL这个玩意,感觉这个东西有点象YQL,但又不太一样,毕竟YQL是属于在线版本而且调用是有次数限制的,htmlSQL已经比较老了,现在不更新了,用laoliu.me站长来说,如果和phpQuery配合使用那是相当的HIGH呀,准备抽空看看。

-----------------------------------------------------------------

又在看读取excel文件的class了,确实需要这样的工具,所幸现在已经成型的Class非常多,很方便就能解决问题。比如phpexcel,黑黑。当然也有非常小的工具,只有几十行,但照样能够读取,只是功能差一点而已。不过,对于我只需要读取sheet内容的人来说就非常适合了。

----------------------------------------------------------------

听说DZX2快出来了,内置整合QQ Connect,这让很多站长很兴奋认为这样是会简化用户注册会带来大量的流量。我是觉得这玩意没什么大用处。。。。