forked from eatvio/eatvio_app
feat(chat): fix native analyze
This commit is contained in:
@@ -5,8 +5,6 @@ import 'package:eatvio_app/features/chat/repositories/chat_repository.dart';
|
||||
import 'package:pusher_client/pusher_client.dart';
|
||||
|
||||
class InitializationCubit extends Cubit<InitializationState> {
|
||||
late final webSocketChannel;
|
||||
|
||||
final ChatRepository chatRepository;
|
||||
|
||||
InitializationCubit({required this.chatRepository}) : super(const InitializationState.loading());
|
||||
@@ -29,20 +27,27 @@ class InitializationCubit extends Cubit<InitializationState> {
|
||||
),
|
||||
);
|
||||
|
||||
PusherClient pusher = PusherClient(
|
||||
PusherClient pusherClient = PusherClient(
|
||||
wsUrl.key,
|
||||
options,
|
||||
autoConnect: true,
|
||||
enableLogging: true,
|
||||
);
|
||||
|
||||
await pusher.connect();
|
||||
|
||||
// Channel channel = pusher.subscribe('private-direct-chat.');
|
||||
// channel.registerListener(classId, method);
|
||||
await pusherClient.connect();
|
||||
|
||||
emit(const InitializationState.success());
|
||||
|
||||
Channel channel = pusherClient.subscribe('private-direct-chat.' + '7909ea56-7822-4d5f-8892-134bc937127f');
|
||||
|
||||
channel.bind("pusher_internal:subscription_succeeded", (PusherEvent? event) {
|
||||
channel.trigger("pusher_internal:subscription_succeeded", {});
|
||||
});
|
||||
|
||||
channel.registerListener('pusher:subscribe', (data) => print(data.toString()));
|
||||
|
||||
} catch (e) {
|
||||
print(e);
|
||||
emit(InitializationState.error(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user