pusher_client icon indicating copy to clipboard operation
pusher_client copied to clipboard

ABANDONNED PACKAGE?

Open nicolasvahidzein opened this issue 3 years ago • 25 comments

Hello everyone,

this package seems abandonned to me. Am i correct in assuming this?

Chinloyal is not reachable and has not closed a ticket since august.

nicolasvahidzein avatar Oct 20 '21 19:10 nicolasvahidzein

Have found any alternative @nicolasvahidzein ?

fabiancrx avatar Oct 22 '21 19:10 fabiancrx

No brother @fabiancrx im stuck. This was the recommended package by the Echo team.

nicolasvahidzein avatar Oct 22 '21 19:10 nicolasvahidzein

@nicolasvahidzein I was taking a look and the pusher Android package just uses the java one, ergo, no platform specific features are used. Assuming that the iOS version neither uses platform specific features I'm thinking about just rolling up a new package using solely Dart. I don't see any WIP from pusher to create a flutter package and one has it deadlines.

fabiancrx avatar Oct 22 '21 20:10 fabiancrx

If you can do your own package that would be awesome. Id be the First to try it.

nicolasvahidzein avatar Oct 22 '21 21:10 nicolasvahidzein

@fabiancrx you can write to me if you need help. I migrated to this plugin

https://github.com/olubunmitosin/laravel_flutter_pusher

and it was a BREEZE! Stop using this one.

nicolasvahidzein avatar Nov 02 '21 19:11 nicolasvahidzein

This should stay open actually.

nicolasvahidzein avatar Nov 02 '21 19:11 nicolasvahidzein

@fabiancrx you can write to me if you need help. I migrated to this plugin

https://github.com/olubunmitosin/laravel_flutter_pusher

and it was a BREEZE! Stop using this one.

does this work with current flutter update for ios and android? testing this tonight :)

ragingallan avatar Nov 03 '21 08:11 ragingallan

Works for me. Not tested on ios yet. Let me know if you have an issue. My skype: nzein9

nicolasvahidzein avatar Nov 03 '21 09:11 nicolasvahidzein

Works for me. Not tested on ios yet. Let me know if you have an issue. My skype: nzein9

sorry can't see you in skype, however here's what I'm getting after implementation

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
#0      EventChannel.binaryMessenger
package:flutter/…/services/platform_channel.dart:473
#1      EventChannel.receiveBroadcastStream.<anonymous closure>
package:flutter/…/services/platform_channel.dart:493
#2      EventChannel.receiveBroadcastStream.<anonymous closure>
package:flutter/…/services/platform_channel.dart:492
#3      _runGuarded (dart:async/stream_controller.dart:773:24)
#4      _BroadcastStreamController._subscribe (dart:async/broadcast_stream_controller.dart:207:7)
#5      _ControllerStream._createSubscription (dart:async/stream_controller.dart:786:19)
#6      _StreamImpl.listen (dart:async/stream_impl.dart:473:9)
#7      LaravelFlutterPusher._init
package:laravel_flutter_pusher/laravel_flutter_pusher.dart:133
#8      new LaravelFlutterPusher
package:laravel_flutter_pusher/laravel_flutter_pusher.dart:89
#9      main
package:ypf/main.dart:18
#10     main
.dart_tool/flutter_build/generated_main.dart:55
#11     _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:127:38)
#12     _rootRun (dart:async/zone.dart:1428:13)
#13     _CustomZone.run (dart:async/zone.dart:1328:19)
#14     _runZoned (dart:async/zone.dart:1863:10)
#15     runZonedGuarded (dart:async/zone.dart:1851:12)
#16     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:125:5)
#17     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

ragingallan avatar Nov 03 '21 12:11 ragingallan

My apologies nzein19 not 9

try again

paste the full code for your implementation

nicolasvahidzein avatar Nov 03 '21 12:11 nicolasvahidzein

Here is the full code sample and how you should get it to work:

//flutter packages
import 'package:laravel_echo/laravel_echo.dart';
//import 'package:flutter_pusher_client/flutter_pusher.dart';
//import 'package:pusher_client/pusher_client.dart';
import 'package:laravel_flutter_pusher/laravel_flutter_pusher.dart';


			PusherOptions options = PusherOptions(
				host: websocketsDomain,
				port: websocketsPort,
				cluster: websocketsCluster,
				encrypted: websocketsEncrypted,
				auth: PusherAuth(
					websocketsAuthEndpointDomain + websocketsAuthEndpointRelativeUrl,
					headers: {
						'Authorization':  'Bearer ' + accessToken,
						'Content-Type': 'application/json',
						'Accept': 'application/json'
					},
				),
    	);
			
			LaravelFlutterPusher pusher = LaravelFlutterPusher(
				websocketsAppId,
				options,
				enableLogging: true,
			);
			
			_echo = Echo(
				broadcaster: EchoBroadcasterType.Pusher,
				client: pusher,
			);
			
			pusher.connect(onConnectionStateChange: _onConnectionStateChange).onError((error, stackTrace) {
				print('error: $error');
			});
			
			//connect to the private channel
			//you can piggy back channel listeners if you are adding more
			_echo!.private('user.${myUserId!}').listen('UserStatusChange', (event) {
				
				print(event);
				
			});
			
			
			
			
	void _onConnectionStateChange(ConnectionStateChange event) {
		
		print('event:');
		print(event);
		print(event.currentState);
		
		if (event.currentState == 'CONNECTED') {
			
			_appStore!.setEcho(_echo);
			
			_appStore!.setWebsocketConnection(true);
			
			_appStore!.incrementWebsocketConnectionAttempt();
			
		} else if (event.currentState == 'DISCONNECTED') {
			
			_appStore!.setWebsocketConnection(false);
			
		}
		
  }
	
	void disconnect() {
		
		//disconnect from the server
		_echo!.disconnect();
		
	}
	

nicolasvahidzein avatar Nov 03 '21 15:11 nicolasvahidzein

Hi @nicolasvahidzein I managed to get a fork of this plugin working for me, and just now uploaded the changes here.

It has all un-merged PR's and other goodies. Changes on the fork as of now are:

  • Null safety
  • #36 by @thijskuilman
  • #31 by @DanielRobert1
  • #12 by @alexkok
  • #8 by @gertdrui
  • Send custom params as form-urlencoded in the body for custom pusher authentication by me

So anyone just feel free to :

  pusher_client:
    git:
      url: https://github.com/fabiancrx/pusher_client

fabiancrx avatar Nov 03 '21 22:11 fabiancrx

Here is the full code sample and how you should get it to work:

//flutter packages
import 'package:laravel_echo/laravel_echo.dart';
//import 'package:flutter_pusher_client/flutter_pusher.dart';
//import 'package:pusher_client/pusher_client.dart';
import 'package:laravel_flutter_pusher/laravel_flutter_pusher.dart';


			PusherOptions options = PusherOptions(
				host: websocketsDomain,
				port: websocketsPort,
				cluster: websocketsCluster,
				encrypted: websocketsEncrypted,
				auth: PusherAuth(
					websocketsAuthEndpointDomain + websocketsAuthEndpointRelativeUrl,
					headers: {
						'Authorization':  'Bearer ' + accessToken,
						'Content-Type': 'application/json',
						'Accept': 'application/json'
					},
				),
    	);
			
			LaravelFlutterPusher pusher = LaravelFlutterPusher(
				websocketsAppId,
				options,
				enableLogging: true,
			);
			
			_echo = Echo(
				broadcaster: EchoBroadcasterType.Pusher,
				client: pusher,
			);
			
			pusher.connect(onConnectionStateChange: _onConnectionStateChange).onError((error, stackTrace) {
				print('error: $error');
			});
			
			//connect to the private channel
			//you can piggy back channel listeners if you are adding more
			_echo!.private('user.${myUserId!}').listen('UserStatusChange', (event) {
				
				print(event);
				
			});
			
			
			
			
	void _onConnectionStateChange(ConnectionStateChange event) {
		
		print('event:');
		print(event);
		print(event.currentState);
		
		if (event.currentState == 'CONNECTED') {
			
			_appStore!.setEcho(_echo);
			
			_appStore!.setWebsocketConnection(true);
			
			_appStore!.incrementWebsocketConnectionAttempt();
			
		} else if (event.currentState == 'DISCONNECTED') {
			
			_appStore!.setWebsocketConnection(false);
			
		}
		
  }
	
	void disconnect() {
		
		//disconnect from the server
		_echo!.disconnect();
		
	}
	

This solution works mate., THANKS!

I'm using ios 15.0.2

ragingallan avatar Nov 04 '21 15:11 ragingallan

Here is the full code sample and how you should get it to work:

//flutter packages
import 'package:laravel_echo/laravel_echo.dart';
//import 'package:flutter_pusher_client/flutter_pusher.dart';
//import 'package:pusher_client/pusher_client.dart';
import 'package:laravel_flutter_pusher/laravel_flutter_pusher.dart';


			PusherOptions options = PusherOptions(
				host: websocketsDomain,
				port: websocketsPort,
				cluster: websocketsCluster,
				encrypted: websocketsEncrypted,
				auth: PusherAuth(
					websocketsAuthEndpointDomain + websocketsAuthEndpointRelativeUrl,
					headers: {
						'Authorization':  'Bearer ' + accessToken,
						'Content-Type': 'application/json',
						'Accept': 'application/json'
					},
				),
    	);
			
			LaravelFlutterPusher pusher = LaravelFlutterPusher(
				websocketsAppId,
				options,
				enableLogging: true,
			);
			
			_echo = Echo(
				broadcaster: EchoBroadcasterType.Pusher,
				client: pusher,
			);
			
			pusher.connect(onConnectionStateChange: _onConnectionStateChange).onError((error, stackTrace) {
				print('error: $error');
			});
			
			//connect to the private channel
			//you can piggy back channel listeners if you are adding more
			_echo!.private('user.${myUserId!}').listen('UserStatusChange', (event) {
				
				print(event);
				
			});
			
			
			
			
	void _onConnectionStateChange(ConnectionStateChange event) {
		
		print('event:');
		print(event);
		print(event.currentState);
		
		if (event.currentState == 'CONNECTED') {
			
			_appStore!.setEcho(_echo);
			
			_appStore!.setWebsocketConnection(true);
			
			_appStore!.incrementWebsocketConnectionAttempt();
			
		} else if (event.currentState == 'DISCONNECTED') {
			
			_appStore!.setWebsocketConnection(false);
			
		}
		
  }
	
	void disconnect() {
		
		//disconnect from the server
		_echo!.disconnect();
		
	}
	

didn't work for me did you still using the same code or something else?

yacinegithub avatar Apr 02 '22 16:04 yacinegithub

For everyone subscribed to this thread an official package is under development by pusher here . Haven't checked its API and capabilities yet, but it should be the way to go for integrating pusher in a flutter app.

If you successfully migrate from this plugin to the official one, would you be kind enough to comment (I'll add my notes as soon as I do), so everyone subscribed can weigh in the decision of migrating .

fabiancrx avatar Apr 13 '22 15:04 fabiancrx

For everyone subscribed to this thread an official package is under development by pusher here . Haven't checked its API and capabilities yet, but it should be the way to go for integrating pusher in a flutter app.

If you successfully migrate from this plugin to the official one, would you be kind enough to comment (I'll add my notes as soon as I do), so everyone subscribed can weigh in the decision of migrating .

Does it compatible/work with the laravel websockets pusher replacement?

yacinegithub avatar Apr 13 '22 19:04 yacinegithub

Sorry @yacinegithub but I don't use laravel 🤷, but it should.

fabiancrx avatar Apr 13 '22 21:04 fabiancrx

For everyone subscribed to this thread an official package is under development by pusher here . Haven't checked its API and capabilities yet, but it should be the way to go for integrating pusher in a flutter app.

If you successfully migrate from this plugin to the official one, would you be kind enough to comment (I'll add my notes as soon as I do), so everyone subscribed can weigh in the decision of migrating .

Does it compatible/work with the laravel websockets pusher replacement?

I'm using this one for laravel. yes, it's working

ragingallan avatar Apr 14 '22 00:04 ragingallan

For everyone subscribed to this thread an official package is under development by pusher here . Haven't checked its API and capabilities yet, but it should be the way to go for integrating pusher in a flutter app. If you successfully migrate from this plugin to the official one, would you be kind enough to comment (I'll add my notes as soon as I do), so everyone subscribed can weigh in the decision of migrating .

Does it compatible/work with the laravel websockets pusher replacement?

I'm using this one for laravel. yes, it's working

thank you, do you mean you use 'laravel_flutter_pusher ' or 'pusher_channels_flutter' package if you meant the second so do you use laravel websockets pusher replacement method, if so would you give us a piece of your code with flutter and laravel needed changes and wich laravel package you use for your api sanctum/passport/jwt

yacinegithub avatar Apr 14 '22 06:04 yacinegithub

Here is the full code sample and how you should get it to work:

//flutter packages
import 'package:laravel_echo/laravel_echo.dart';
//import 'package:flutter_pusher_client/flutter_pusher.dart';
//import 'package:pusher_client/pusher_client.dart';
import 'package:laravel_flutter_pusher/laravel_flutter_pusher.dart';


			PusherOptions options = PusherOptions(
				host: websocketsDomain,
				port: websocketsPort,
				cluster: websocketsCluster,
				encrypted: websocketsEncrypted,
				auth: PusherAuth(
					websocketsAuthEndpointDomain + websocketsAuthEndpointRelativeUrl,
					headers: {
						'Authorization':  'Bearer ' + accessToken,
						'Content-Type': 'application/json',
						'Accept': 'application/json'
					},
				),
    	);
			
			LaravelFlutterPusher pusher = LaravelFlutterPusher(
				websocketsAppId,
				options,
				enableLogging: true,
			);
			
			_echo = Echo(
				broadcaster: EchoBroadcasterType.Pusher,
				client: pusher,
			);
			
			pusher.connect(onConnectionStateChange: _onConnectionStateChange).onError((error, stackTrace) {
				print('error: $error');
			});
			
			//connect to the private channel
			//you can piggy back channel listeners if you are adding more
			_echo!.private('user.${myUserId!}').listen('UserStatusChange', (event) {
				
				print(event);
				
			});
			
			
			
			
	void _onConnectionStateChange(ConnectionStateChange event) {
		
		print('event:');
		print(event);
		print(event.currentState);
		
		if (event.currentState == 'CONNECTED') {
			
			_appStore!.setEcho(_echo);
			
			_appStore!.setWebsocketConnection(true);
			
			_appStore!.incrementWebsocketConnectionAttempt();
			
		} else if (event.currentState == 'DISCONNECTED') {
			
			_appStore!.setWebsocketConnection(false);
			
		}
		
  }
	
	void disconnect() {
		
		//disconnect from the server
		_echo!.disconnect();
		
	}
	

This solution works mate., THANKS!

I'm using ios 15.0.2

for this code i cant get it to work would you give us how you wrote your variables like websocketsDomain, websocketsPort, websocketsCluster and so on i think i made a msitake writing their value thanks

yacinegithub avatar Apr 14 '22 08:04 yacinegithub

Okay so it's 2023 now. What package should I use exactly? the deadlines are so tight :"(

OmarYehiaDev avatar May 16 '23 15:05 OmarYehiaDev

@OmarYehiaDev , use the official packages from the pusher team https://pub.dev/publishers/pusher.com/packages

fabiancrx avatar May 16 '23 18:05 fabiancrx

This one is dope: dart_pusher_channels

nicolasvahidzein avatar May 16 '23 20:05 nicolasvahidzein

Hi, I am kind of a noob at this @fabiancrx is there a way to set the host, wsport, wssPort on the official Pusher flutter package?

Emmanuel-Etukudo avatar Nov 13 '23 12:11 Emmanuel-Etukudo

Hi, I am kind of a noob at this @fabiancrx is there a way to set the host, wsport, wssPort on the official Pusher flutter package?

Hi @Emmanuel-Etukudo Did you find a solution for it?

Korefey avatar Feb 09 '24 13:02 Korefey