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
# File: main_emulate.py | |
import flask | |
from main import heroes | |
app = flask.Flask('functions') | |
methods = ['GET', 'POST', 'PUT', 'DELETE'] | |
@app.route('/heroes', methods=methods) | |
@app.route('/heroes/<path>', methods=methods) | |
def catch_all(path=''): |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"math/rand" | |
"net/http" | |
"sync" | |
"time" |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"runtime" | |
"time" |
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 firebase_admin | |
from firebase_admin import firestore | |
import flask | |
app = flask.Flask(__name__) | |
firebase_admin.initialize_app() | |
SUPERHEROES = firestore.client().collection('superheroes') | |
@app.route('/heroes', methods=['POST']) |
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
Flask==1.0.2 | |
firebase-admin==2.13.0 | |
google-cloud-firestore==0.29.0 |
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
runtime: python37 | |
service: heroes | |
api_version: 1 |
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
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const packageName = 'com.google.firedemos'; | |
const displayName = 'FireFlicks'; | |
const app = await admin.projectManagement().createAndroidApp(packageName, displayName); | |
console.log('Created new Android App:', app.appId); |
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
const androidApps = await admin.projectManagement().listAndroidApps(); | |
androidApps.forEach(async (androidApp) => { | |
const metadata = await androidApp.getMetadata(); | |
console.log(metadata.appId, metadata.packageName, metadata.displayName); | |
}); |
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
const appId = '1:134547978015:android:967eb1618809ce3a'; | |
const androidApp = admin.projectManagement().androidApp(appId); | |
const metadata = await androidApp.getMetadata(); | |
console.log(metadata.appId, metadata.packageName, metadata.displayName); |
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 com.google.auth.oauth2.GoogleCredentials; | |
import com.google.cloud.firestore.DocumentSnapshot; | |
import com.google.cloud.firestore.Firestore; | |
import com.google.firebase.FirebaseApp; | |
import com.google.firebase.FirebaseOptions; | |
import com.google.firebase.messaging.FirebaseMessaging; | |
import com.google.firebase.messaging.Message; | |
import com.google.firebase.messaging.Notification; | |
public class Main { |