Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.5.3'
}
}

Expand All @@ -32,6 +32,6 @@ android {
disable 'InvalidPackage'
}
dependencies {
implementation 'com.pusher:pusher-java-client:2.0.0'
implementation 'com.pusher:pusher-java-client:2.0.2'
}
}
14 changes: 12 additions & 2 deletions android/src/main/java/com/ninjasolutions/pusher/PusherPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.pusher.client.channel.Channel;
import com.pusher.client.channel.ChannelEventListener;
import com.pusher.client.channel.PresenceChannelEventListener;
import com.pusher.client.channel.PrivateChannel;
import com.pusher.client.channel.PrivateChannelEventListener;
import com.pusher.client.channel.PusherEvent;
import com.pusher.client.channel.User;
Expand Down Expand Up @@ -377,9 +378,18 @@ private void trigger(MethodCall call, Result result) {
final String channelName = json.getString("channelName");
final String eventName = json.getString("eventName");

Channel channel = channels.get(channelName);
String data = "{}";
if (json.has("data")) {
data = json.getString("data");
}

channel.trigger(eventName, "{}");
Channel channel = channels.get(channelName);
if (channel instanceof PrivateChannel) {
if (isLoggingEnabled) {
Log.d(TAG, String.format("Trigger event: %s with data: %s", eventName, data));
}
((PrivateChannel) channel).trigger(eventName, data);
}
} catch (Exception e) {
if (isLoggingEnabled) {
Log.d(TAG, String.format("unbind exception: %s", e.getMessage()));
Expand Down
9 changes: 1 addition & 8 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -183,7 +176,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
version: "0.2.15"
typed_data:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
version: "0.2.15"
timing:
dependency: transitive
description:
Expand Down