Flutter pusher with npusher

Nhan Cao
1 min readJan 15, 2021

To deal with wrong data format response from backend with pusher via Laravel echo

This example works both android and ios

Lib

npusher: ^1.0.3

Example

/// Init pusher
Future<void> initPusher(int eventId) async {
try {
await _pusher.init(
appKey: Config.I.env.pusherKey,
authUrl: '${Config.I.env.apiBaseUrl}/broadcasting/auth',
headers: <String, String>{
'Authorization': 'Bearer ${token.user.bearerToken}'…

--

--