2020-10-07 02:33:06 +06:30
|
|
|
import 'package:fcs/data/provider/messaging_fcm.dart';
|
2020-09-06 02:36:57 +06:30
|
|
|
|
|
|
|
|
import 'messaging_service.dart';
|
|
|
|
|
|
|
|
|
|
class MessagingServiceImp implements MessagingService {
|
|
|
|
|
MessagingServiceImp();
|
|
|
|
|
|
|
|
|
|
static MessagingFCM messagingFCM;
|
|
|
|
|
|
|
|
|
|
@override
|
2020-09-20 05:34:49 +06:30
|
|
|
void init(onMessage,
|
|
|
|
|
{OnNotify onLaunch, OnNotify onResume, OnSetupComplete onSetupComplete}) {
|
|
|
|
|
messagingFCM = MessagingFCM(onMessage,
|
|
|
|
|
onLaunch: onLaunch,
|
|
|
|
|
onResume: onResume,
|
|
|
|
|
onSetupComplete: onSetupComplete);
|
2020-09-06 02:36:57 +06:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Future<void> subscribe(String topic) {
|
|
|
|
|
return messagingFCM.unsubscribeToTopic(topic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Future<void> unsubscribe(String topic) {
|
|
|
|
|
return messagingFCM.unsubscribeToTopic(topic);
|
|
|
|
|
}
|
|
|
|
|
}
|