且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

黑莓推送通知报名时间

更新时间:2023-02-26 21:27:12

注册应该是持久的。但RIM公司的服务器有时片状:你看到了这个一贯发生

Registration should be persistent. But RIM's servers are sometimes flaky: are you seeing this happen consistently?

您使用OS 5.0.0或更早的版本?如果是旧的操作系统版本,你需要确保你的监听线程一直在运行。对于5.0.0及以上版本,操作系统需要照顾这个给你。

Are you using OS 5.0.0 or earlier? If it's the older OS versions, you need to make sure your listening thread is always running. For 5.0.0 and above, the OS takes care of this for you.

另一种认为涉及证实交付和应用的确认。如果您在使用本服务级别(可无论是推或加推要领),但是你的应用程序不承认通知暂停,RIM可能标志着你的设备,并不会发送任何进一步的通知。

Another thought relates to confirmed delivery and application acknowledgment. If you are using this level of service (available for either Push Plus or Push Essentials), but your application is not acknowledging the notification, RIM may mark your device as suspended and won't send it any further notifications.

默认是使用未确认的交付方式。如果你在Java中使用RIM的服务器端的SDK,你有code是这样的:

The default is to use the UNCONFIRMED delivery method. If you're using RIM's server-side SDK in Java, and you have code like this:

pushMessageControl.getQualityOfService().setDeliveryMethod(DeliveryMethod.CONFIRMED);

或者,如果你不使用他们的SDK,但在你的推送请求XML如下:

Or if you're not using their SDK, but have the following in your push request XML:

<quality-of-service delivery-method="confirmed"/>

然后你需要调用下面​​在通知处理你的黑莓应用程序:

Then you need to call the following in your BlackBerry app in the notification handler:

pushInputStream.accept();

这是推SDK的一部分 pushdemo 样本设备应用程序支持可选的应用程序的确认,所以你应该学习的code,看看该怎么办。

The pushdemo sample device application that is part of the Push SDK supports optional application acknowledgment, so you should study that code to see what to do.