无法在模拟器上测试BlackBerry PushService SDK

时间:2013-08-19 13:05:15

标签: blackberry push-notification blackberry-simulator blackberry-push

我是Java开发人员,但最近我得到了一些与BlackBerry Push Service实现相关的项目。我的目标是为Push Initiator(即内容提供者)编写服务器端实现。但为了测试这个,我还需要使用一些示例推送启用应用程序。

我已经浏览了BB开发者指南并完成了以下步骤:

  1. 注册BB推送服务评估API并收到包含所有必需详细信息的确认邮件:appId,pwd,PPG Url for BIS,端口号等。

  2. 为低级Push-Imitator(即Web应用程序内容提供程序)和示例推送启用应用程序(BB推送服务开发人员指南中提供的PushDemo_sample)安装了BB Push安装程序。

  3. 现在我在模拟器上测试这个支持推送的应用程序并尝试注册。但是,当示例应用程序尝试在注册BB推送服务器之前首先使用推送发起程序(CP)进行订阅时。我已经评论了下面的代码,因为我不想要订阅部分。 RegisterCommand类处理订阅和注册。

    protected void execute() throws Exception {
            // first we register with Content Provider
            Logger.log("Reached RegidterCommand execute() method .. but eacapingCMD_SUBSCRIBE");
            //ContentProviderProtocol.performCommand( ContentProviderProtocol.CMD_SUBSCRIBE, username, password, isEnterprise, tx ); // commented
            // if the registration is successful we register with BPS
            Logger.log("Now Going to register with PPG");
            BpasProtocol bpasProtocol = PushLibFactory.getBpasProtocol();
            bpasProtocol.register( tx, isEnterprise );
            // update the registered state
            PersistentStorage.setRegistered( true );
        }
    

    但是在使用正确的appId,PortNumber和BPS服务器URL,虚拟推送启动器应用程序URL配置应用程序之后,当我单击寄存器时,它显示一些IOException:

    Command 'register' failed with error: java.io.IOException: could not find a service book entry for IPPP.
    

    在模拟器上的应用程序日志中,我可以看到它正在尝试打开BB推送评估网址,并在网址后添加一些参数,如下所示:

    Opening URL: http://cpXXXX.pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=XXXX-sxxxxxxxxxxxxxxxxxxxxxxxxxxxx&osversion=7.1.0.318&model=9900&deviceside=false&ConectionType=mds-public
    

    这里我只想尝试使用BB Push服务器注册我的模拟器。是否无法在模拟器上测试Push服务?或者我做错了什么?

    还有一个人怀疑示例推送应用程序的PushLib50类的register()方法是如何在eval URL之后附加额外的参数?

    请帮忙。指出我是否做了任何错误的实现推送服务。

1 个答案:

答案 0 :(得分:2)

您无法在模拟器中测试推送通知。你需要真正的设备。 请参阅this site

BlackBerry Push Service是BlackBerry智能手机实时,永远在线体验的重要组成部分。它为您的用户提供了一种高效可靠的信息发送方式。它还允许您的应用程序在后台处理信息,并在需要注意时通知用户。