Make stream_chat_persistence a add on dependency instead of shipping it with the llc

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-01-27 12:52:37 +05:30
parent f48b7c8882
commit 1521558304
16 changed files with 126 additions and 187 deletions
@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:example/main.dart';
import 'package:flutter_apns/flutter_apns.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
hide Message;
@@ -36,8 +37,17 @@ Future backgroundHandler(Map<String, dynamic> notification) async {
print('new notification ${notification}');
final messageId = notification['data']['id'];
final notificationData =
await NotificationService.getAndStoreMessage(messageId);
final notificationData = await NotificationService.getAndStoreMessage(
messageId: messageId,
storeMessageHandler: (messageResponse) {
return chatPersistentClient.updateChannelState(
ChannelState(
messages: [messageResponse.message],
channel: messageResponse.channel,
),
);
},
);
showLocalNotification(
notificationData.message,