问题
I'm trying to get Pusher working on Android. Here are my needs.
- Must support "private-" channels
- Must support secure connections
- Must be able to override the pusher/auth endpoint.
Note: I've already tried the following routes....
- 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)
Anyone else have any luck with this?
回答1:
Pusher have a Java library: https://github.com/pusher/pusher-java-client
There's a very simple sample application here: https://github.com/pusher/pusher-android-example
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
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.
来源:https://stackoverflow.com/questions/14824292/pusher-on-android