问题描述
我试图让工作推Android上。这里是我的需求。
I'm trying to get Pusher working on Android. Here are my needs.
- 必须支持私营的渠道
- 必须支持安全连接
- 必须能够覆盖助推/ AUTH终点。
请注意:我已经尝试了以下路线....
Note: I've already tried the following routes....
- 装载pusher.js在WebView中,让它回落到SockJS
- (似乎不支持安全连接)
- 的 (需要私钥推送到客户端,也没有及时更新)
- (不支持私人渠道)
- loading pusher.js in a WebView and letting it fall back to SockJS
- https://github.com/pusher/pusher-phonegap-android (Does not seem to support secure connections)
- https://github.com/EmoryM/Android_Pusher/blob/master/src/com/emorym/android_pusher (Requires a private key to be pushed to the client, also not up to date)
- https://github.com/jmschultz/JavaPusherClient (Does not support private channels)
任何人有任何运气吗?
推荐答案
我们(推)正在研究一种新的Java库:的
We (Pusher) are working on a new Java library: https://github.com/pusher/pusher-java-client
这里有一个非常简单的示例应用程序:
There's a very simple sample application here:https://github.com/pusher/pusher-android-example
这是仍在发展,很可能会发生一些错误需要冰释前嫌。
It's still under development so there will probably be some bugs that need to be ironed out.
您可以告诉推
实例使用通过 PusherOptions
加密连接。看到:
https://github.com/pusher/pusher-java-client/blob/master/src/main/java/com/pusher/client/PusherOptions.java#L24
You can tell the Pusher
instance to use an encrypted connection via PusherOptions
. See:https://github.com/pusher/pusher-java-client/blob/master/src/main/java/com/pusher/client/PusherOptions.java#L24
我觉得这是有可能被更新为默认值,或者至少在一个未加密的连接失败,重新连接将尝试通过SSL。
I think this is likely to be updated to be the default, or at least reconnection will try over SSL if an unencrypted connection fails.
这篇关于推Android上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!