ConnectyCube / android-messenger-app

Chat and voice / video calling app using ConnectyCube
https://connectycube.com
Apache License 2.0
51 stars 23 forks source link

Push is being sent to both environments even I'm defining only one #107

Closed tappbell closed 2 years ago

tappbell commented 2 years ago

Hi! It seems that the setEnvironment(ConnectycubeEnvironment.PRODUCTION) is not doing anything. After sending an event I see on the queue https://admin.connectycube.com/apps/XXXXX/service/push-notifications/queue That 2 were sent, and as I have only production subscriptions, the second one that tries to send to development always fails. I don't want to send anything to development. Here's the code, am I missing anything?

    ConnectycubeEvent event = new ConnectycubeEvent();
    event.setUserIds(scids);
    event.setEnvironment(ConnectycubeEnvironment.PRODUCTION);
    event.setNotificationType(ConnectycubeNotificationType.PUSH);
    event.setMessage(json.toString());

    ConnectycubePushNotifications.createEvent(event).performAsync(new EntityCallback<ConnectycubeEvent>() {
        @Override
        public void onSuccess(ConnectycubeEvent event, Bundle args) {
            Log.e("PUSH NOTIF","ok");
        }

        @Override
        public void onError(ResponseException errors) {
            Log.e("PUSH ERROR",errors.getMessage());
        }
    });
TatankaConCube commented 2 years ago

Some time ago our back-end team released the feature for sending the push notifications to both environments at once. Before it, a lot of our customers had issues related to this feature and we decided to simplify the logic with environments, now our server just sends the push notification to both environments.