Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABANDONNED PACKAGE? #39

Open
nicolasvahidzein opened this issue Oct 20, 2021 · 25 comments
Open

ABANDONNED PACKAGE? #39

nicolasvahidzein opened this issue Oct 20, 2021 · 25 comments
Assignees

Comments

@nicolasvahidzein
Copy link

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.

@fabiancrx
Copy link

Have found any alternative @nicolasvahidzein ?

@nicolasvahidzein
Copy link
Author

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

@fabiancrx
Copy link

@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.

@nicolasvahidzein
Copy link
Author

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

@nicolasvahidzein
Copy link
Author

@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
Copy link
Author

This should stay open actually.

@ragingallan
Copy link

@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 :)

@nicolasvahidzein
Copy link
Author

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

@ragingallan
Copy link

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)

@nicolasvahidzein
Copy link
Author

My apologies nzein19 not 9

try again

paste the full code for your implementation

@nicolasvahidzein
Copy link
Author

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();
		
	}
	

@fabiancrx
Copy link

fabiancrx commented Nov 3, 2021

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:

So anyone just feel free to :

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

@ragingallan
Copy link

ragingallan commented Nov 4, 2021

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

@yacinegithub
Copy link

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?

@fabiancrx
Copy link

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 .

@yacinegithub
Copy link

yacinegithub commented Apr 13, 2022

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?

@fabiancrx
Copy link

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

@ragingallan
Copy link

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

@yacinegithub
Copy link

yacinegithub commented Apr 14, 2022

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
Copy link

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

@OmarYehiaDev
Copy link

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

@fabiancrx
Copy link

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

@nicolasvahidzein
Copy link
Author

This one is dope: dart_pusher_channels

@Emmanuel-Etukudo
Copy link

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?

@Korefey
Copy link

Korefey commented Feb 9, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants