Skip to content

Instantly share code, notes, and snippets.

@ToeJamson
Created January 19, 2018 23:25
Show Gist options
  • Select an option

  • Save ToeJamson/c01d92ca9aac9dca399d8c25c7dacf64 to your computer and use it in GitHub Desktop.

Select an option

Save ToeJamson/c01d92ca9aac9dca399d8c25c7dacf64 to your computer and use it in GitHub Desktop.
public class LocationPublishPnCallback extends SubscribeCallback {
...
@Override
public void message(PubNub pubnub, PNMessageResult message) {
if (!message.getChannel().equals(watchChannel)) {
return;
}
try {
Log.d(TAG, "message: " + message.toString());
Map<String, String> newLocation = JsonUtil.fromJson(message.getMessage().toString(), LinkedHashMap.class);
locationMapAdapter.locationUpdated(newLocation);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment