Разделы презентаций


Firebase

Содержание

123FeaturesDB AdvantagesCloud FirestoreAuthentication45ML Kit6PricingAgenda

Слайды и текст этой презентации

Слайд 1Quickly development
of high-quality app
Firebase

Quickly development    of high-quality appFirebase

Слайд 21
2
3
Features
DB Advantages
Cloud Firestore
Authentication
4
5
ML Kit
6
Pricing
Agenda

123FeaturesDB AdvantagesCloud FirestoreAuthentication45ML Kit6PricingAgenda

Слайд 3Features
Source: https://raizlabscom-wpengine.netdna-ssl.com/dev/wp-content/uploads/sites/10/2016/11/firebase-features.png

FeaturesSource: https://raizlabscom-wpengine.netdna-ssl.com/dev/wp-content/uploads/sites/10/2016/11/firebase-features.png

Слайд 4DB Advantages
Nothing
Realtime Database
Data is easier to organize at scale
Offline support

for web clients
Indexed queries with compound sorting and filtering
Atomic write

and transaction operations
Scaling will be automatic
Simpler, more powerful security for mobile, web, and server SDKs.

Cloud Firestore

DB AdvantagesNothingRealtime DatabaseData is easier to organize at scaleOffline support for web clientsIndexed queries with compound sorting

Слайд 5DB Disadvantages
All
Realtime Database
Beta
Cloud Firestore

DB DisadvantagesAllRealtime DatabaseBetaCloud Firestore

Слайд 6Web
Cloud Firestore
npm install firebase --save
1. Package install
const firebase =

require("firebase");
2. Manually require
3. Initialize
firebase.initializeApp({   apiKey: '### FIREBASE API KEY ###',  

authDomain: '### AUTH DOMAIN ###',   projectId: '### PROJECT ID ###' }); // Disable deprecated features firebase.firestore().settings({   timestampsInSnapshots: true });

Get started

Manage data

Secure data

API reference

Cloud Functions

Summary

Indexes

WebCloud Firestorenpm install firebase --save 1. Package installconst firebase = require(

Слайд 7Android
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
npm install firebase --save


1. Add lib to app/build.gradle
implementation 'com.google.firebase:firebase-firestore:17.1.2'
2. Manually require
3. Initialize
FirebaseFirestore

db = FirebaseFirestore.getInstance();

Summary

Indexes

AndroidCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsnpm install firebase --save 1. Add lib to app/build.gradleimplementation 'com.google.firebase:firebase-firestore:17.1.2' 2.

Слайд 8Data model
Get started
Manage data
Secure data
API reference
Cloud Functions
NoSql
Each document contains a

set of key-value pairs
All documents must be stored in collections
The

names of documents within a collection are unique
Subcollections can be stored in document
Collections and documents are created implicitly
If you delete all of the documents in a collection, it no longer exists

Cloud Firestore

Summary

Indexes

Data modelGet startedManage dataSecure dataAPI referenceCloud FunctionsNoSqlEach document contains a set of key-value pairsAll documents must be

Слайд 9Add data
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
db.collection("cities").doc("LA").set({     name:

"Los Angeles",     state: "CA",     country: "USA" });
// Add a

new document with a generated id. db.collection("cities").add({     name: "Tokyo",     country: "Japan" }) .then(function(docRef) {     console.log("Document written with ID: ", docRef.id); }) .catch(function(error) {     console.error("Error adding document: ", error); });

// Add a new document with a generated id. var newCityRef = db.collection("cities").doc(); // later... newCityRef.set(data);

Summary

Indexes

Add dataCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsdb.collection(

Слайд 10Update data
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
var washingtonRef =

db.collection("cities").doc("DC"); // Set the "capital" field of the city 'DC' return washingtonRef.update({  

  capital: true }) .then(function() {     console.log("Document successfully updated!"); }) .catch(function(error) {     // The document probably doesn't exist.     console.error("Error updating document: ", error); });


// Create an initial document to update. var frankDocRef = db.collection("users").doc("frank"); frankDocRef.set({     name: "Frank",     favorites: { food: "Pizza", color: "Blue", subject: "recess" },     age: 12 }); // To update age and favorite color: db.collection("users").doc("frank").update({     "age": 13,     "favorites.color": "Red" }) .then(function() {     console.log("Document successfully updated!"); });

Summary

Indexes

Update dataCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsvar washingtonRef = db.collection(

Слайд 11Delete data
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions

// Delete collections

//

Deleting collections from a Web client is not recommended.
// Deleting

collections from an iOS client is not recommended.
// Deleting collections from an Android client is not recommended.

// Delete document by id

db.collection("cities").doc("DC").delete().then(function() {     console.log("Document successfully deleted!"); }).catch(function(error) {     console.error("Error removing document: ", error); });

// Remove the 'capital' field from the document var removeCapital = cityRef.update({     capital: firebase.firestore.FieldValue.delete() });

Summary

Indexes

Delete dataCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functions // Delete collections // Deleting collections from a Web

Слайд 12Transaction
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
var sfDocRef = db.collection("cities").doc("SF"); db.runTransaction(function(transaction)

{     return transaction.get(sfDocRef).then(function(sfDoc) {         if (!sfDoc.exists)

{             throw "Document does not exist!";         }         var newPopulation = sfDoc.data().population + 1;         if (newPopulation <= 1000000) {             transaction.update(sfDocRef, { population: newPopulation });             return newPopulation;         } else {             return Promise.reject("Sorry! Population is too big.");         }     }); }).then(function(newPopulation) {     console.log("Population increased to ", newPopulation); }).catch(function(err) {     // This will be an "population is too big" error.     console.error(err); });

Summary

Indexes

TransactionCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsvar sfDocRef = db.collection(

Слайд 13Some data
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
var citiesRef =

db.collection("cities"); citiesRef.doc("SF").set({     name: "San Francisco", state: "CA", country: "USA",    

capital: false, population: 860000,     regions: ["west_coast", "norcal"] });
citiesRef.doc("LA").set({     name: "Los Angeles", state: "CA", country: "USA",     capital: false, population: 3900000,     regions: ["west_coast", "socal"] });
citiesRef.doc("DC").set({     name: "Washington, D.C.", state: null, country: "USA",     capital: true, population: 680000,     regions: ["east_coast"] });

Summary

Indexes

Some dataCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsvar citiesRef = db.collection(

Слайд 14Get data
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
var docRef =

db.collection("cities").doc("SF"); docRef.get().then(function(doc) {     if (doc.exists) {         console.log("Document

data:", doc.data());     } else {         // doc.data() will be undefined in this case         console.log("No such document!");     } }).catch(function(error) {     console.log("Error getting document:", error); });

Summary

Indexes

Get dataCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsvar docRef = db.collection(

Слайд 15Filtering
Where(, , )
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
db.collection("cities").where("capital",

"==", true)     .get()     .then(function(querySnapshot) {        

querySnapshot.forEach(function(doc) {             // doc.data() is never undefined for query doc snapshots             console.log(doc.id, " => ", doc.data());         });     })     .catch(function(error) {         console.log("Error getting documents: ", error);     });

Summary

Indexes


Слайд 16
Array
Filtering
Where(, , )
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
citiesRef.where("regions",

"array-contains", "west_coast")
Compound
citiesRef.where("state", ">=", "CA").where("state", "",

1000000)

Summary

Indexes


Слайд 17y
Filtering
OrderBy(, )
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Compound
citiesRef.orderBy("name", "desc")


citiesRef.orderBy("state").orderBy("population", "desc")
Summary
Indexes

yFilteringOrderBy(, )Cloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsCompoundcitiesRef.orderBy(

Слайд 18y
Filtering
Limit()
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Compound
citiesRef.limit(2)
citiesRef.limit(2).limit(1)
Summary
Indexes

yFilteringLimit()Cloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsCompoundcitiesRef.limit(2) citiesRef.limit(2).limit(1) SummaryIndexes

Слайд 19y
Filtering

startAt()
startAfter()
endAt()
endBefore()
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Summary
Indexes

yFilteringstartAt()startAfter()endAt()endBefore()Cloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsSummaryIndexes

Слайд 20y
Realtime updates
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
db.collection("cities").doc("SF")     .onSnapshot(function(doc)

{         var source = doc.metadata.hasPendingWrites ? "Local"

: "Server";         console.log(source, " data: ", doc.data());     });

Summary

Indexes

yRealtime updatesCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsdb.collection(

Слайд 21y
Realtime updates
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
let unsubscribe =

db.collection("cities").where("state", "==", "CA")     .onSnapshot(function(snapshot) {         snapshot.docChanges().forEach(function(change)

{             if (change.type === "added") {                 console.log("New city: ", change.doc.data());             }             if (change.type === "modified") {                 console.log("Modified city: ", change.doc.data());             }             if (change.type === "removed") {                 console.log("Removed city: ", change.doc.data());             }         });     });
unsubscribe();

Summary

Indexes

yRealtime updatesCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionslet unsubscribe = db.collection(

Слайд 22y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Summary
Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsSummaryIndexes

Слайд 23y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
onCreate, onUpdate, onDelete, onWrite
exports.countNameChanges

= functions.firestore     .document('users/{userId}')     .onUpdate((change, context) => {    

  const data = change.after.data();       const previousData = change.before.data();       // We'll only update if the name has changed. // This is crucial to prevent infinite loops.       if (data.name == previousData.name) return null;       // Retrieve the current count of name changes       let count = data.name_change_count;       if (!count) {         count = 0;       }       // Then return a promise of a set operation to update the count       return change.after.ref.set({         name_change_count: count + 1       }, {merge: true});     });

Summary

Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsonCreate, onUpdate, onDelete, onWriteexports.countNameChanges = functions.firestore     .document('users/{userId}')    

Слайд 24y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Limitations and guarantees
Cloud Firestore

is currently in beta which may result in unexpected behavior.

A

few known limitations include:
It may take up to 10 seconds for a function to be triggered after a change to Cloud Firestore data

As with all background functions, event ordering is not guaranteed. In addition, a single event may result in multiple Cloud Functions invocations, so for the highest quality ensure your functions are written to be idempotent.

Summary

Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsLimitations and guaranteesCloud Firestore is currently in beta which may result

Слайд 25y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
service cloud.firestore {   match

/databases/{database}/documents {     match // {       allow read,

write: if ;     }   } }

// Allow read/write access on all documents to any user signed in to the application service cloud.firestore {   match /databases/{database}/documents {     match /{document=**} {       allow read, write: if request.auth.uid != null;     }   } }

Summary

Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsservice cloud.firestore {   match /databases/{database}/documents {     match //

Слайд 26y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
service cloud.firestore {   match

/databases/{database}/documents {     match /cities/{city} {       // Make

sure a 'users' document exists for the requesting user before       // allowing any writes to the 'cities' collection       allow create: if exists(/databases/$(database)/documents/users/$(request.auth.uid))       // Allow the user to delete cities if their user document has the       // 'admin' field set to 'true'       allow delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.admin == true     }   } }

Summary

Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functionsservice cloud.firestore {   match /databases/{database}/documents {     match /cities/{city}

Слайд 27y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
10 for single-document requests

and query requests.

20 for multi-document reads, transactions, and batched writes.

The previous limit of 10 also applies to each operation.

For example, imagine you create a batched write request with 3 write operations and that your security rules use 2 document access calls to validate each write. In this case, each write uses 2 of its 10 access calls and the batched write request uses 6 of its 20 access calls.

Access call limits

Summary

Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud Functions10 for single-document requests and query requests.20 for multi-document reads, transactions,

Слайд 28y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Summary
Indexes
For each set operation, Cloud Firestore

updates:

One ascending single-field index per non-array field

One descending single-field index

per non-array field

One array-contains single-field index for the array field
yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsSummaryIndexesFor each set operation, Cloud Firestore updates:One ascending single-field index per non-array fieldOne

Слайд 29y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Summary
Indexes

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsSummaryIndexes

Слайд 30y
Cloud Firestore
Get started
Manage data
Secure data
API reference
Cloud Functions
Summary
Indexes
If you attempt a

compound query with a range clause that doesn't map to

an existing index, you receive an error. The error message includes a direct link to create the missing index in the Firebase console.

citiesRef.where("country", "==", "USA").orderBy("population", "asc") citiesRef.where("country", "==", "USA").where("population", "<", 3800000) citiesRef.where("country", "==", "USA").where("population", ">", 690000)

yCloud FirestoreGet startedManage dataSecure dataAPI referenceCloud FunctionsSummaryIndexes	If you attempt a compound query with a range clause that

Слайд 31y
Not bad NoSQL with Transactions, Indexes, Filtering

Realtime updates

Offline support

Fast

development

Platform support: Web, iOs, Android, Java, Python, NODE.js, .Net

Get started
Manage

data

Secure data

API reference

Cloud Functions

Summary

Cloud Firestore

Indexes

yNot bad NoSQL with Transactions, Indexes, Filtering Realtime updatesOffline supportFast developmentPlatform support: Web, iOs, Android, Java, Python,

Слайд 32y
Authentication
Get started
Sign up
firebase.auth().createUserWithEmailAndPassword(email, password)
.catch(function(error) {   // Handle Errors here.   var

errorCode = error.code;   var errorMessage = error.message;   // ... });

yAuthenticationGet startedSign upfirebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {   // Handle Errors here.   var errorCode = error.code;   var

Слайд 33y
Authentication
Get started
Sign in
firebase.auth().signInWithEmailAndPassword(email, password)
.catch(function(error) {   // Handle Errors here.   var

errorCode = error.code;   var errorMessage = error.message;   // ... });

yAuthenticationGet startedSign infirebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) {   // Handle Errors here.   var errorCode = error.code;   var

Слайд 34y
Authentication
Get started
Authentication state observer
firebase.auth().onAuthStateChanged(function(user) {   if (user) {     //

User is signed in.     var displayName = user.displayName;    

var email = user.email;     var emailVerified = user.emailVerified;     var photoURL = user.photoURL;     var isAnonymous = user.isAnonymous;     var uid = user.uid;     var providerData = user.providerData;     // ...   } else {     // User is signed out.     // ...   } });
yAuthenticationGet startedAuthentication state observerfirebase.auth().onAuthStateChanged(function(user) {   if (user) {     // User is signed in.  

Слайд 35y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 36y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 37y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 38y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 39y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 40y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 41y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks
y

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarksy

Слайд 42Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks

Ml KitIntroductionTextFaceBarcodeLabel imagesLandmarks

Слайд 43Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks
y
On device
y
Cloud

Ml KitIntroductionTextFaceBarcodeLabel imagesLandmarksyOn deviceyCloud

Слайд 44y
Ml Kit
Introduction
Text
Face
Barcode
Label images
Landmarks
Photo: Arcalino / Wikimedia Commons / CC BY-SA

yMl KitIntroductionTextFaceBarcodeLabel imagesLandmarksPhoto: Arcalino / Wikimedia Commons / CC BY-SA 3.0

Слайд 45Pricing

Pricing

Слайд 46Pricing

Pricing

Слайд 47Pricing

Pricing

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика