Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Firebase messaging into EnsembleService #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions lib/generated/EnsembleServices.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import 'package:ensemble/framework/placeholder/camera_manager.dart';
// Uncomment to enable camera services
// import 'package:ensemble_camera/camera_manager.dart';

// import 'package:ensemble/util/notification_utils.dart';
// import 'package:firebase_messaging/firebase_messaging.dart';

import 'package:get_it/get_it.dart';

/// TODO: This class should be generated to enable selected Services
Expand All @@ -12,10 +16,14 @@ class EnsembleServices {
}

void init() {
initServices(useCamera: false, useLocation: false);
initServices(
useCamera: false, useLocation: false, useFirebaseMessaging: false);
}

void initServices({required bool useCamera, required bool useLocation}) {
void initServices(
{required bool useCamera,
required bool useLocation,
required bool useFirebaseMessaging}) {
// Uncomment to enable camera services
// if (useCamera) {
// GetIt.I.registerSingleton<CameraManager>(CameraManagerImpl());
Expand All @@ -24,11 +32,24 @@ class EnsembleServices {
// }

if (useLocation) {

} else {

} else {}

if (useFirebaseMessaging) {
// FirebaseMessaging.onMessage.listen((RemoteMessage message) {
// Ensemble.externalDataContext.addAll({
// 'title': message.notification?.title,
// 'body': message.notification?.body,
// });
// notificationUtils.handleRemoteNotification();
// });

// FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
// Ensemble.externalDataContext.addAll({
// 'title': message.notification?.title,
// 'body': message.notification?.body,
// });
// notificationUtils.handleRemoteNotificationOpened();
// });
}
}


}
}
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2

# firebase_messaging: ^14.6.5

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down