(no title)
rikelmens | 3 years ago
You can leave the bucket fully redable / writable by anyone, or limit who can do what.
Player A would upload the JSON to it and get the shareable URL: ================================================================== import { getStorage, ref, uploadString } from "firebase/storage"; const storage = getStorage(); const storageRef = ref(storage, 'some-child');
const state = '{foo:bar}'; uploadString(storageRef, state) .then((snapshot) => { console.log('Uploaded the state!'); return snapshot.ref.getDownloadURL(); }) .then((url) => { console.log(`Shareable state url: + ${url}`); }) ====================================================
And Player B would simply HTTP GET the shared URL.
No comments yet.