You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why api msg send one time but pusher event got message twice
Is it a crash report? Submit stack traces or anything that you think would help
no crash
Any improvements you suggest
remove redundant data push at the same time
sample code:
in Application
` pusherOptions = new PusherOptions().setCluster(cluster_pusher);
push = new Pusher(key_pusher, pusherOptions);
push.connect();`
in fragment activity
` if (AppControll.push.getConnection().getState().compareTo(ConnectionState.CONNECTING) == 0){
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.CONNECTED) == 0){
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.DISCONNECTING) == 0){
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.DISCONNECTED) == 0){
AppControll.push.connect();
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.RECONNECTING) == 0){
}
if (AppControll.push.getChannel(Config.TOPIC_GLOBAL) == null){
channel = AppControll.push.subscribe(Config.TOPIC_GLOBAL);
}else{
channel = AppControll.push.getChannel(Config.TOPIC_GLOBAL);
}
channel.bind(Config.PUSHER_EVENT, new SubscriptionEventListener() {
@Override
public void onEvent(PusherEvent event) {
Log.i("Pusher", "Received event with data: " + event.getData()); <-- this received twice.
}
}
`
CC @pusher/mobile
The text was updated successfully, but these errors were encountered:
I am unable to replicate this issue. It could be possible that you have two connections/subscriptions on the client receiving the event. Does your activity get loaded more than once?
Perhaps you could log the socket ID alongside the event receipt log? This would help identify if multiple connections are being established.
What is the issue?
Why api msg send one time but pusher event got message twice
Is it a crash report? Submit stack traces or anything that you think would help
no crash
Any improvements you suggest
remove redundant data push at the same time
![debug_console_pusher](https://user-images.githubusercontent.com/6707224/87639186-75d2b400-c777-11ea-95e7-e575584c7b50.png)
![debug_log_android](https://user-images.githubusercontent.com/6707224/87639243-897e1a80-c777-11ea-8e39-455e037cc17c.png)
sample code:
in Application
` pusherOptions = new PusherOptions().setCluster(cluster_pusher);
in fragment activity
` if (AppControll.push.getConnection().getState().compareTo(ConnectionState.CONNECTING) == 0){
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.CONNECTED) == 0){
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.DISCONNECTING) == 0){
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.DISCONNECTED) == 0){
AppControll.push.connect();
}
if (AppControll.push.getConnection().getState().compareTo(ConnectionState.RECONNECTING) == 0){
}
`
CC @pusher/mobile
The text was updated successfully, but these errors were encountered: