Skip to content

Instantly share code, notes, and snippets.

View adityathakurxd's full-sized avatar
Learning

Aditya Thakur adityathakurxd

Learning
View GitHub Profile
@adityathakurxd
adityathakurxd / index.js
Last active October 22, 2024 16:35
Node Server code to use Firebase Admin SDK to send out push notifications. When a post endpoint is hit on the Node JS server, it delivers a notification to a Flutter app using Firebase Messaging.
import {initializeApp, applicationDefault } from 'firebase-admin/app';
import { getMessaging } from "firebase-admin/messaging";
import express, { json } from "express";
import cors from "cors";
process.env.GOOGLE_APPLICATION_CREDENTIALS;
const app = express();
app.use(express.json());
@adityathakurxd
adityathakurxd / main.dart
Created March 22, 2022 14:58
Flutter Workshop Day 1 (main dart code
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@adityathakurxd
adityathakurxd / index.html
Created September 12, 2021 07:55
Code for index.html when initializing Firebase for Flutter Web. Note: Use latest version of firebasejs. Link to video: https://youtu.be/l0cFOUJJcGQ
<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-analytics.js"></script>
<script>
//Replace with your config data
var firebaseConfig = {
apiKey: "Anha1wShmI",
authDomain: ".firebaseapp.com",
projectId: "vacachal",