the feedback service

当用户删除你的app,或者其他原因造成某些device_token无效时,就没有必要再给这些用户发push了。浪费时间、浪费带宽,尤其是注册量足够大的时候尤为重要。

解决方法:http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW1

我们是通过javapns发push,对应的方法:https://code.google.com/p/javapns/wiki/FeedbackService

 import javapns.*;
        
 public class FeedbackTest {
 
       public static void main(String[] args) {
        
                List<Device> inactiveDevices = Push.feedback("keystore.p12", "keystore_password", false);
                /* remove inactive devices from your own list of devices */ 

    }
 }

  原理:苹果会把无效的token放在一个池子里,每次连接并请求时,他会返回你这些tokens并且从池子中删掉。

因此,需要定期的去跑这个job,而且及时的更新到自己的数据库。这是一个循序渐进的过程~

 

 

posted @ 2013-04-07 20:07  Gukw  阅读(475)  评论(0编辑  收藏  举报