Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pusher on Android

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?

like image 486
Ryan Pfeffer Avatar asked Jun 22 '26 22:06

Ryan Pfeffer


1 Answers

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.

like image 50
leggetter Avatar answered Jun 24 '26 11:06

leggetter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!