Closed rabichawila closed 2 years ago
I built my signed APK (sha1) but i did not publish it to PlayStore yet. ( i didn't think it mattered), Now my application is not working in after building, but it does works fine on debug mode.
Here is how i get the instance of the singleton.
PusherSocket.init(authToken: _authToken); Echo echo = PusherSocket.instance;
Here is my singleton code:
class PusherSocket { static Echo _echo; static PusherSocket _pusherSocket; PusherSocket._instance() { print("initializing echo"); } static Echo get instance { return _echo; } static Echo init({String authToken}) { if (_pusherSocket == null) { PusherAuth _auth; if (authToken != null) { _auth = PusherAuth( 'https://example.com/broadcasting/auth', headers: { 'Authorization': '$authToken', }, ); } PusherOptions options = PusherOptions( host: wsURL, port: wsPort, encrypted: true, auth: _auth != null ? _auth : null, cluster: cluster, ); FlutterPusher pusher = FlutterPusher(wsKey, options, enableLogging: false); _echo = new Echo({ 'broadcaster': 'pusher', 'client': pusher, }); // initialzie _pusherSocket = PusherSocket._instance(); } } }
having a similar issue.
Tried this solution and it seems to be working.
https://stackoverflow.com/questions/63939157/chat-using-laravel-echo-in-my-flutter-app
Not directly related to this package
Vesion: ^0.2.5
I built my signed APK (sha1) but i did not publish it to PlayStore yet. ( i didn't think it mattered), Now my application is not working in after building, but it does works fine on debug mode.
Here is how i get the instance of the singleton.
Here is my singleton code:
pusher_socket.dart