Firebase
blog.kimizuka.orgæ¨å¹´ä½ã£ããFirebase Cloud Messagingãããæè¿éç¥ãéããã¦ããªããªã¨æã£ã¦ããã®ã§ãããé ãã°ããªãããMessaging.sendAll()ãå»æ¢ããã¦ãããã¨ã«æ°ãä»ãã¾ãããåãæ¥ãåãããã«ããã®ã§ããã°ãMessaging.sendAll() ã Meâ¦
ãã¡ããä¸è¨3ã¤ã®è¨äºã®çµã¿åããã§ããblog.kimizuka.org blog.kimizuka.org blog.kimizuka.orgM5StickC Plus2ã§GPS座æ¨ãåå¾ãã¦ãCloud Firestorã«éä¿¡ãã¾ãã æºåãããã® M5StickC Plus2 GPSã¦ããã Arduino Firebaseã®ã¢ã«ã¦ã³ãï¼Blazeãã©ã³ã«â¦
å®è£ æé ⶠããã±ã¼ã¸ãç¨æãã yarn add firebase firebase-tools â· package.jsonãç·¨éãã package.json { "name": "functions-to-firestore", "scripts": { "login": "firebase login", "init": "firebase init", "emulate": "firebase emulators:starâ¦
å®è£ æé ⶠããã±ã¼ã¸ãç¨æãã yarn add firebase firebase-tools â· package.jsonãç·¨éãã package.json { "name": "gps-distance", "scripts": { "login": "firebase login", "init": "firebase init", "emulate": "firebase emulators:start", "deploâ¦
https://docs.m5stack.com/ja/core/m5stickc_plus ããå¼ç¨ååä½ã£ãCloud Functionsã®é¢æ°ã®HTTPããªã¬ã¼ãWiFiã«æ¥ç¶ããM5StickC Plusããå©ãã¦ã¿ã¾ããblog.kimizuka.org WiFiæ¥ç¶ HTTPãªã¯ã¨ã¹ã JSONã®ãã¼ã¹ ã¨ããããªãã¨ãããªããã¨ãããã¤ãâ¦
ååã¯ãã¢ã¸ã¥ã¼ã«ãã³ãã©ã¼ç¡ãã§Cloud Firestoreããããã£ã¨ä½¿ãã¾ããããä»åã¯ãCloud Functionsã使ã£ã¦ãCloud Firestoreã«ä¿åããå¤ãèªã¿åãã¦ã§ãAPIãä½ãã¾ããblog.kimizuka.orgå®éã®ã¨ãããä»åã®ç¨éï¼Cloud Firestoreã«ä¿åããå¤ãâ¦
ãã¤ã¦ãFirebase Hosting + Cloud Firestore + Firebase Authenticationã使ãã¤ã¤ãã¢ã¸ã¥ã¼ã«ãã³ãã©ã¼ç¡ãã®ãããã¿ã¤ããä½ã£ããã¨ãããã¾ãããblog.kimizuka.orgä»åãã¢ã¸ã¥ã¼ã«ãã³ãã©ã¼ç¡ãã§ãCloud Firestoreããããã£ã¨ä½¿ããããã¿ã¤ãâ¦
æ®æ®µã¯éçãµã¤ãã®ãã¹ãã£ã³ã°ã« GitHub Pages ã Netlify ãã¤ãããã¨ãå¤ãã®ã§ãããBasicèªè¨¼ãããããå ´åãGitHub Pagesã§ã¯å®ç¾ã§ããªãã§ãããNetlifyã§ã¯ææã®æ©è½ãªã®ã§ãã©ããããããªã¨æã£ã¦ãã¾ãããä¸æ¦ã¯ã Heroku ã使ããããªã¨ãâ¦
Firebaseã§å¿åèªè¨¼ãä½æããéãèªåã¯ãªã¼ã³ã¢ãããæå¹ã«ããã°30æ¥éã§å¿åã¦ã¼ã¶ã¼ãåé¤ãããããã«ãªãã¾ããfirebase.google.comããããå ´åã«ãã£ã¦ã¯ã¹ã¯ãªããã§å¿åã¦ã¼ã¶ã¼ãã¾ãã£ã¨åé¤ãããå ´åãããã§ãããã ãããªã¨ãã«ä½¿ããã¹â¦
ããã¥ã¡ã³ã ãè¦ãªãããupdateEmailã使ã£ã¦å®è£ ãã¦ã¿ã¾ãããfirebase.google.com import { updateEmail, User } from 'firebase/auth'; async function changeEmail(currentUser: User, newEmail: string) { return updateEmail(currentUser, newEmailâ¦
çºè¡ãããURLãæ®éã«å©ãã¨ã¯ãã¹ãªãªã¸ã³ã«ãªã£ã¦ãã¾ãã®ã§ã©ããããã®ãã¨æã£ã¦ããã®ã§ããããã¹ãã£ã³ã°ã®ãªã©ã¤ãã«ã¼ã«ã使ãã¨åé¿ã§ãã¾ããfirebase.google.comã¨ããããå ¬å¼ã®ããã¥ã¡ã³ãã«è©³ããæé ãæ¸ãã¦ããã®ã§ããã®éãé²ããã°Fâ¦
æ¬çªç°å¢ã§Cloud Firestoreã使ãå ´åãã»ãã¥ãªãã£ã«ã¼ã«ããã£ããè¨å®ããªãã¨ãããªãã§ããããããã¿ã¤ãã¨ãã¦èª°ã§ãèªã¿æ¸ãOKã¨ãã¦ãããã£ã¨å®è£ ãããå ´åãããã¾ããä»åã¯ã ãã°ã¤ã³ä¸è¦ã§èª°ã§ããã¼ã¿ãèªã¿æ¸ãã§ãã ã¢ã¸ã¥ã¼ã«ãã³ãã©â¦
ååã¯ãNavigator.setAppBadgeã使ã£ã¦ã¢ã¤ã³ã³ã«ããã¸ãã¤ãã¾ãã ãblog.kimizuka.orgä»åã¯ãã¼ã¯ã³ããã¼ã¿ãã¼ã¹ã«ç»é²ãã¦ããµã¼ãããããã·ã¥éç¥ãéä¿¡ãã¦ã¿ã¾ãã Safariã§ããã·ã¥éç¥ãåãåãæ¡ä»¶ ⶠhttpsã§Webãµã¤ããã¤ãã â· â¶ã®ã¦ã§ãâ¦
Cloud Firestore ããªã¬ã¼ ã使ã£ã¦ãããã¥ã¡ã³ãã«å¤æ´ããã£ãéã«ããã·ã¥éç¥ãéã£ã¦ã¿ã¾ãããfirebase.google.com åæ Cloud Firestoreã«ããã¤ã¹ãã¼ã¯ã³ãä¿åããï¼tokensã³ã¬ã¯ã·ã§ã³ã«ããã¤ã¹IDãããã¥ã¡ã³ãIDã«ãã¦ä¿åããï¼ Cloud Firesâ¦
é¢é£è¨äº Expoã§ã¤ãã£ãã¢ããªã«ãã¼ã«ã«ãµã¼ãããããã·ã¥éç¥ãéã blog.kimizuka.org Expoã§ã¤ãã£ãã¢ããªã«ãµã¼ãããããã·ã¥éç¥ãéã blog.kimizuka.orgããã¾ã§ããã¼ã«ã«ãµã¼ãããããã·ã¥éç¥éä¿¡ããµã¼ãããããã·ã¥éç¥éä¿¡ã試ãã¾ãâ¦
æã¯Cloud Functionsã«å ããCloud Pub/SubãCloud Schedulerã§è¨å®ãå¿ è¦ã ã£ãããã§ããããã¾ã¯Cloud Functionsã§è¨å®ããã°ãèªåçã«Cloud Pub/Subã®ãããã¯ã¨Cloud Schedulerã®ã¸ã§ããä½æããã¾ãã便å©ãªæ代ã«ãªãã¾ããããfirebase.google.comâ¦
çµè« firebase 9.6.7ã使ã£ãã解決ãããï¼expoã¯44.0.0ï¼ ãã¨ã®çºç«¯ ãã¡ãã®ããã¥ã¡ã³ããã¿ãªãããExpoã¢ããªã«Firebaseãå°å ¥ãããã¨ããã®ã§ãããiOSã§ãAndroidã§ãinitializeAppã®ã¿ã¤ãã³ã°ã§ãCan't find variableï¼IDBindexãã¨ã¨ã©ã¼ã表示â¦
ã³ã³ã½ã¼ã«ããã¯åé¤ã§ãããfirebase-toolsã使ãã firebase hosting:disableãå®è¡ããã°åé¤ã§ãã¾ãã
ããã¾ã§ãNext.jsã®ããã¸ã§ã¯ããFirebase Hostingã«ãããã¤ããã¨ãã¯ãNext.jsã®è¨å®ãå¤æ´ãã¦URLã®æ«å°¾ã«ã¹ã©ãã·ã¥ãã¤ãã¦ãã¾ãããblog.kimizuka.orgããéã«ãFirebase Hostingã®è¨å®ãå¤æ´ãã¦URLæ«å°¾ã®.htmlãåé¤ãããã¨ãã§ãããã¨ãç¥ãâ¦
Firebase Hostingã«ã¯Googleã¢ããªãã£ã¯ã¹ã¨ã®é£æºæ©è½ãã¤ãã¦ãã¾ããfirebase.google.comåã¯ããã¾ã§é£æºæ©è½ã使ã£ããã¨ããªããFirebase Hostingã使ã£ã¦ãã¦ããã¿ã°ãnpmã§ã¢ããªãã£ã¯ã¹ãå°å ¥ãã¦ããã®ã§ããããã®åº¦åãã¦ä½¿ã£ã¦ã¿ã¾ãããé£â¦
ã¿ã¤ãã«ã«ãã¹ã¦ãæ¸ãã¦ãã¾ã£ãã®ã§ãæ¬æã«æ¸ããã¨ããªããªã£ã¦ãã¾ã£ãã®ã§ããã ããæ¥ã firebase deploy ã§ãFirebase Hostingã«ãããã¤ãããã¨è©¦ã¿ãã¨ããã Error: Failed to get Firebase project PROJECT_NAME. Please make sure the projeâ¦
ãã¾æ¯ãè¿ãã¨åç´ãªè©±ã ãããã®ãããã¯ã¾ã£ãã ãã¨ã®çºç«¯ çµè« çã£ãã㨠ãã¨ã®çºç«¯ Nuxt.js + Firebase Hosting + Cloud Functions ã§SSRãå®ç¾ãã¦ããããã¸ã§ã¯ããåããªããªã£ã {"code": "MODULE_NOT_FOUND"} ã¨è¡¨ç¤ºãããã®ã§ããªã«ãã¢ã¸ã¥â¦
çµè« èæ¯ Realtime Databaseã®ã«ã¼ã«ã®æ¸ãæ¹ ã«ã¼ã«ã®ãµã³ãã« å ¨å¡èªã¿æ¸ãå¯ å ¨å¡èªã¿æ¸ãä¸å¯ å ¨å¡èªã¿è¾¼ã¿å¯ãæ¸ãè¾¼ã¿ä¸å¯ å ¨å¡èªã¿è¾¼ã¿å¯ãäºåã«æå®ããGoogleã¢ã«ã¦ã³ãã®ã¿æ¸ãè¾¼ã¿å¯ 注æäºé çµè« { "rules": { ".read": "true", ".write": "aâ¦
ãã¹ã¦ã¯ããã¥ã¡ã³ãã«æ¸ãã¦ãããã¨ã§ã¯ããã®ã§ãããé±æ«ã«ã»ãã®ãã¯ã¾ã£ãã®ã§ã¡ã¢ãæ®ãã¦ããã¾ãã Cloud Functionsã¨ã¯ Google Cloud Functions ã¯è»½éãªã³ã³ãã¥ã¼ãã£ã³ã° ã½ãªã¥ã¼ã·ã§ã³ã§ããããããããã¼ã¯ãµã¼ãã¼ãã©ã³ã¿ã¤ã ç°å¢ã管çâ¦