forked from eatvio/eatvio_app
refactor(blog_post): Refactoring blog post create and conflict resolve
This commit is contained in:
@@ -15,37 +15,6 @@ class InitializationCubit extends Cubit<InitializationState> {
|
||||
|
||||
final wsUrl = await chatRepository.getWebsocket();
|
||||
|
||||
PusherOptions options = PusherOptions(
|
||||
host: 'socket.mobile-stage.eatvio.ru',
|
||||
wsPort: 443,
|
||||
encrypted: true,
|
||||
auth: PusherAuth(
|
||||
'wss://' + wsUrl.host + '/app/' + wsUrl.key,
|
||||
headers: {
|
||||
'Authorization': 'Bearer ${TokenStorage.getTokenFromStorage()}',
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
PusherClient pusherClient = PusherClient(
|
||||
wsUrl.key,
|
||||
options,
|
||||
autoConnect: true,
|
||||
enableLogging: true,
|
||||
);
|
||||
|
||||
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