This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta content="IE=Edge" http-equiv="X-UA-Compatible"> | |
| <meta name="description" content="A new Flutter project."> | |
| <!-- iOS meta tags & icons --> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter_fcm_web_example/notification_helper.dart'; | |
| import 'package:firebase/firebase.dart' as firebaseWeb; | |
| import 'package:flutter_fcm_web_example/notification_model.dart'; | |
| /// Web-only helper to manage notifications. | |
| class FirebaseMessagingHelper implements NotificationHelper { | |
| FirebaseMessagingHelper._internal(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'package:firebase_messaging/firebase_messaging.dart'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter_fcm_web_example/notification_helper.dart'; | |
| import 'package:flutter_fcm_web_example/notification_model.dart'; | |
| /// Mobile-only helper to manage notifications. | |
| class FirebaseMessagingHelper implements NotificationHelper { | |
| FirebaseMessagingHelper._internal(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter_fcm_web_example/notification_model.dart'; | |
| abstract class NotificationHelper { | |
| Future<bool> get isReady; | |
| Stream<NotificationModel> get stream; | |
| void close(); | |
| Future<String> getToken([bool force = false]); | |
| Future<dynamic> requestPermission(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta content="IE=Edge" http-equiv="X-UA-Compatible"> | |
| <meta name="description" content="A new Flutter project."> | |
| <!-- iOS meta tags & icons --> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:firebase_core/firebase_core.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_fcm_web_example/my_app.dart'; | |
| void main() async { | |
| WidgetsFlutterBinding.ensureInitialized(); | |
| await Firebase.initializeApp(); | |
| runApp(MyApp()); | |
| } |
NewerOlder