Skip to content

Instantly share code, notes, and snippets.

View abhishek0196's full-sized avatar
🎯
Focusing

abhishek0196

🎯
Focusing
View GitHub Profile
@abhishek0196
abhishek0196 / addClaim.java
Last active October 18, 2022 01:56
Firebase Custom claims using Firbase Function and Android
//this methid calls the firebase function by its name , and passes the parameter using Map, the parameters are email and role.
private Task<String> addRole() {
// Create the arguments to the callable function.
Map<String, Object> data = new HashMap<>();
data.put("email", email);
data.put("push", true);
data.put("role",role);
return mFunctions
.getHttpsCallable("addRole")
@abhishek0196
abhishek0196 / index.ts
Last active July 5, 2022 20:39
Copying data from Firebase Firestore to a Google Sheet in real time via Cloud Functions
import * as functions from 'firebase-functions'
import * as _ from 'lodash'
import { google } from 'googleapis'
const sheets = google.sheets('v4')
import * as admin from 'firebase-admin';
admin.initializeApp();
const spreadsheetId = '' // Your Sheets ID