通过BES / BIS,黑莓手机推送通知 [英] Push Notifications through BES/BIS , BlackBerry

查看:164
本文介绍了通过BES / BIS,黑莓手机推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用OS&LT推送通知; 7.X。

I am trying to use push notifications for OS < 7.X .

我下载的样本服务器/客户端code。我部署在客户端code我的设备和提供的tomcat的低级别样本code上。

I downloaded the sample server / client code. I deployed the client code on my device and the low-level-sample code on the tomcat provided.

有关记录,当我注册了这里推送通知我注册使用BIS选项。现在,我实际上是赋予了黑莓我是它使用BES通知(我不认为虽然这是我要说明问题的根源..)。

For the record , when i registered for push notifications here i registered using the BIS option. Now that i was actually given a blackberry i was informed it is using BES ( i dont think though this is the root of the problem that i am going to describe..).

在设备上,在示例应用程序我把所有我从收到的电子邮件中给出的正确的设置。

On the device , in the sample application i put all the correct settings given from the email i received.

这两个我的电脑是运行Tomcat服务器,我的电话都连接到相同的WiFi。

Both my pc which is running the tomcat server and my phone are connected to the same wifi.

我是从设备浏览器尝试连接到服务器,如 https://196.84.32.112:8443/low-level-sample

I am trying from the device browser to connect to the server , eg https://196.84.32.112:8443/low-level-sample

和浏览器中正常打开页面,这意味着我能够从移动连接到我的服务器。

and the browser opens the page normally , meaning that i am able to connect to my server from the mobile.

现在,当我打从设备示例应用程序注册(我曾尝试上的设置都BIS / BES选项),我总是得到以下错误:

Now when i hit register from the device sample app ( i have tried both BIS/BES options on the settings ) , i always get the following error :

请求注册失败。通过java.io.IOException异常原因:网络运行[订阅]失败。确保内容提供商URL访问。

Request to register failed. Cause by java.io.IOException: Network operation[Subscribe] failed. Make sure that Content Provider URL is accessible.

在日志中我得到:

打开网址:我的服务器的URL附有喜欢的用户名/密码/模式/连接类型等信息
内容提供商网络命令[订阅]失败,造成无法连接到 196.84.32.112:8443
命令注册失败,出现错误:java.io.IOException异常:网络运行[订阅]失败。确保内容提供商URL访问。

Opening URL: my server url appended with info like username/password/model/connection type etc Content Provider network command [ Subscribe] failed , caused by could not connect to 196.84.32.112:8443 Command "register" failed with error: java.io.IOException: Network operation[Subscribe] failed. Make sure that Content Provider URL is accessible.

一个想到的是,我应该为新推键重新注册并使用BIS / BES选项,而不是只BIS的,但这里的问题似乎是与本地服务器,而不是RIM的服务器没有连接。我已经尝试过,虽然注册和我等待邮件用新的设置。

A thought is that i should register again for new push keys and use the BIS/BES option instead of only BIS , but here the problem seems to be no connectivity with the local server , not the RIM server. I already tried to register though and i am waiting for the mail with the new settings.

另外,我有点与BIS / BES选项混淆。我不知道如果我的用户将有BIS或者BES启用所以我把什么在我的code?!在示例应用程序,它要求我,当应用程序将要生产的BIS或者BES但之间进行选择,我需要以编程方式做出这样的选择我会选择什么?或者这种选择只对应用的评价/开发和生产上有另一台服务器做?

Also i am a bit confused with the BIS / BES option. I have no idea if my users will have BIS or BES enabled so what do i put in my code ?! In the sample application it asks me to select between BIS or BES but when the app is going to production and i need to programmatically make that choice what will i choose?! Or this choice is made only for the evaluation/development of the app and on production there is another server ?

推荐答案

我觉得所有正确的事情已经在这里说,但我希望我们能巩固一些问题的答案,并包裹了这个问题了。

I think all the right things have been said here, but I'm hoping we can consolidate some of the answers, and wrap this question up.

您还没有分享您的code,这使得事情变得更加困难,但很多人使用RIM /黑莓提供PushDemo源,其中一个连接后缀是很难$ C $光盘 / pushdemo / COM /轮辋/样本/设备/推/ PushUtils.java

You haven't shared your code, which makes things more difficult, but many people use the RIM/BlackBerry provided PushDemo source, where a connection suffix is hardcoded in /pushdemo/com/rim/samples/device/push/PushUtils.java:

private static String getConnectionSuffix() {
    return ";deviceside=false;ConnectionType=mds-public";
}

我也看了您的其他问题。

通过这样做,你已经很难codeD青苗的黑莓传输类型。 <一href=\"http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-make-an-HTTP-or-socket-connection/ta-p/445879\"相对=nofollow>黑莓手机支持多种不同的传输的,像BES,BIS,围兜,或WAP。该青苗运输将从您的设备发送请求,到黑莓的服务器,这是在互联网上。 (注:这部分可能是混乱到iOS / Android开发,因为这些平台不提供苹果/谷歌的网络中介继电器正常的HTTP / S流量的)

By doing this, you've hardcoded the BlackBerry transport type of BIBS. BlackBerry supports many different transports, like BES, BIS, BIBS, or WAP. The BIBS transport will send the request from your device, out to BlackBerry's servers, which are on the internet. (Note: this part is probably confusing to an iOS/Android developer, since those platforms don't provide Apple/Google network intermediaries to relay normal HTTP/S traffic)

然后,该请求被转发到你的服务器,它是:

Then, the request is relayed to your server, which is at:

196.84.32.112:8443

我是pretty确保TCP / IP端点不可从网上(我不能达到它)。所以,这就是为什么它失败了你。

I'm pretty sure that TCP/IP endpoint is not available from the Internet (I can't reach it). So, that's why it fails for you.

您可以把这个网址

https://196.84.32.112:8443/low-level-sample

并将其粘贴到您的BlackBerry设备的浏览器,它会工作。您的设备配置为BES,它使用贵公司的内部服务器。这些内部服务器的可以达到 196.84.32.112:8443 端点,因此它似乎为你工作。但是,那是因为你还没有硬$ C $光盘的交通的,因为你在使用推code getConnectionSuffix()。该设备的浏览器是足够聪明,想出一个可行的运输和BES作品达到这个的联网的服务器。

and paste it into your BlackBerry device's browser, and it will work. Your device is configured for BES, which uses your company's internal servers. Those internal servers can reach the 196.84.32.112:8443 endpoint, so it seems to work for you. But, that's because you haven't hardcoded the transport, as you have in the push code that uses getConnectionSuffix(). The device browser is smart enough to figure out a transport that works, and BES works to reach that intranet server.

我们希望,这解释了混淆的部分。

Hopefully, that explains the confusing part.

正如其他人所说,一个解决办法是让贵公司的IT人员通过他们的防火墙,使IP地址196.84.32.112和端口8443进行访问。这将使黑莓服务器顺利到达了。

As others have said, a solution is to get your company's IT people to make IP address 196.84.32.112 and port 8443 accessible through their firewall. That would allow the BlackBerry servers to reach it successfully.

另一种解决办法是改变PushUtils.java code,以避免运输青苗:

Another solution would be to change the PushUtils.java code to avoid the BIBS transport:

private static String getConnectionSuffix() {
    return ";deviceside=false";
}

如果你想真正灵活code,那么我建议重写了PushUtils.java code,因为它似乎使用pre-5.0的HTTP连接的逻辑。 <一href=\"http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/io/transport/ConnectionFactory.html\"相对=nofollow>连接工厂在OS 5.0+ 使这更容易,更强大的,支持多种传输时...

If you want really flexible code, then I'd suggest rewriting that PushUtils.java code, because it appears to use the pre-5.0 HTTP connection logic. ConnectionFactory in OS 5.0+ makes this easier, and more robust, when supporting multiple transports ...

要回答你的问题有关支持与多个用户传输,看看<一个href=\"http://supportforums.blackberry.com/t5/Java-Development/Sample-$c$c-Using-the-ConnectionFactory-class-in-a-BrowserField/ta-p/532860\"相对=nofollow>这个blackberry.com例如,特别是 MyConnectionFactory 类。它可以让你选择哪个传输您的应用程序允许,并尝试的第一个

To answer your question about supporting users with multiple transports, take a look at this blackberry.com example, specifically the MyConnectionFactory class. It allows you to select which transports your app allows, and which it tries first.

最后,让你的服务器公开与否的决定取决于它如何去使用,以及你是否将有非企业Internet客户端尝试与您的企业服务器注册。

Ultimately, the decision to make your server public or not depends on how it's going to be used, and whether you'll have non-corporate internet clients trying to register with your corporate server.

这篇关于通过BES / BIS,黑莓手机推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆