Pusher on Android

谁都会走 提交于 2020-01-04 04:26:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!