Skip to content

Why api msg send one time but pusher event got message twice #274

@hafiz013

Description

@hafiz013

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
debug_log_android

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions