Skip to content

Instantly share code, notes, and snippets.

View birchb's full-sized avatar

birchb

View GitHub Profile
@yusufkandemir
yusufkandemir / README.md
Created June 23, 2020 18:25
Quasar + FCM(Firebase Cloud Messaging) Setup

What to do next?

Manage The Subscription State

Manage the subscription state using localStorage, IndexedDB, or a server-side solution(e.g. in Firestore, store per-user), depending on the flow of your app.

Notification UI/UX

Create a notification section in settings, in navbar or just prompt it directly(not recommended, bad UX). On UI interaction such as a subscribe button, call subscribeNotifications with the related parameters(subscribe = true/false, token), then persist the notification state.

Create Notifications

@Laebrye
Laebrye / firestore_service.dart
Created May 19, 2020 09:17
A FirestoreService class - heavily influenced by Andrea Bizzotto's excellent courses
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
import 'package:rxdart/rxdart.dart';
class FirestoreService {
FirestoreService._();
static final instance = FirestoreService._();
CollectionReference collectionReference(String path) {