Pusher stops handling events in IOS release mode

673 views Asked by At

I have a flutter application that uses Pusher beams to receive messages it's all working as expected in Android, in IOS when I run the app in debug mode it works fine as usual receives events even when the app is in Foreground but when I run it in release mode in xcode it stops receiving events in the background and it receives all of the events that were sent while the app was in the background once I restore it to the foreground this is my code putting it in the bloc of the home screen:

PusherOptions options = PusherOptions(
      auth: PusherAuth(
        url + 'broadcasting/auth',
        headers: {
          'Authorization': 'Bearer $token',
        },
      ),
      cluster: configurationModel.pusherAppCluster,
    );

    PusherClient pusher = PusherClient(
        configurationModel.pusherAppKey,
        options,
        autoConnect: false
    );

    pusher.connect();

    // Subscribe to a private channel
    Channel channel = pusher.subscribe(pusherChannel);

    // Bind to listen for events called "order-status-updated" sent to "private-orders" channel
    channel.bind(pusherEvent, (PusherEvent event) {
      _showNotificationCustomSound();
    });
1

There are 1 answers

2
croxx5f On

Well, I've been there. I used that exact package and it does not seem to be maintained anymore. I made a fork here. It has updated versions of base libraries like the iOS one, null safety and other goodies, at github I listed all the changes made. Please use that version and tell me if it solves your issue.

You can add it your your project as follows:

  pusher_client:
    git:
      url: https://github.com/fabiancrx/pusher_client
      ref: 7da7dddb