【问题标题】:Unable to Test BlackBerry PushService SDK on Simulator无法在模拟器上测试 BlackBerry PushService SDK
【发布时间】:2013-08-19 13:05:14
【问题描述】:

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

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

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

  2. 为low-level-Push-Imitator(即网络应用内容提供者)安装了BB Push安装程序和支持推送的示例应用(BB Push服务开发者指南中提供了PushDemo_sample)。

    李>

现在我正在模拟器上测试这个支持推送的应用程序并尝试注册。但是由于示例应用程序在注册 BB Push 服务器之前尝试先订阅 Push-Initiator(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 Push eval url,并在 url 之后附加了一些参数,如下所示:

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 服务器上注册我的模拟器。不能在模拟器上测试推送服务吗?还是我做错了什么?

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

请帮忙。指出我在实现推送服务时是否做错了什么。

【问题讨论】:

  • 您无法在模拟器中测试推送通知。你需要真正的设备。

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


【解决方案1】:

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

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

【讨论】:

  • 您好 Signare,是的,我们无法在模拟器上测试推送通知是真的,因为所有模拟器都具有相同的 PIN 码和其他原因。谢谢你帮助我。现在我已经在设备上安装了应用程序并能够收到推送消息。但是为了测试/实现整个推送服务,我使用了 BB 开发人员指南上提供的示例 PushDemo 应用程序。以及底层推送发起者的推送服务SDK。
猜你喜欢
  • 1970-01-01
  • 2023-03-16
  • 1970-01-01
  • 2016-01-31
  • 1970-01-01
  • 2016-10-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多