Cloud Firestore is a cloud-hosted, NoSQL database that your iOS, Android, and web apps can access directly via native SDKs.
Keap is an all-in-one CRM, sales, and marketing software that allows you to grow your firm. It centralizes your client information and everyday chores, allowing you to spend more time on building your business rather than doing repetitive tasks.
Want to explore Cloud Firestore + Keap quick connects for faster integration? Here’s our list of the best Cloud Firestore + Keap quick connects.
Explore quick connectsIt's easy to connect Cloud Firestore + Keap without coding knowledge. Start creating your own business flow.
New Document Within a Firestore Collection
Triggers when a new appointment created.
Triggers when a new company created.
Triggers when a new contact created.
Trigger when a new invoice created.
Trigger when a new payment received.
Triggers when new tag is created.
Triggers when a new task is created.
Triggers when a tag is added to a contact the first time.
Triggers when an existing contact is updated.
Creates a new document within a Cloud Firestore collection.
Creates a new company.
Creates a new invoice.
Creates a new note on a contact record.
Creates a new task.
Creates a new contact or updates an existing contact.
Apply tags to a contact.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
In this article, I will discuss how Cloud Firestore and Keap can be integrated in a real-time mobile application. When a user changes a data in a database(Cloud Firestore), it should be updated in the server(Keap. I will also discuss how to use these two services to create a secure mobile application.
Cloud Firestore is a cloud-based NoSQL document database that helps build real-time mobile apps. It allows developers to store and sync data across multiple clients in real time. Cloud Firestore promises high-availability, strong consistency, no locks, horizontal scaling, and enterprise-grade security.
Keap provides a simple and secure way to store sensitive data in mobile apps. It implements a serverless design, which means developers do not need to implement any server code. It has a very simple API and requires only a few steps to set it up.
Now, let’s see how to integrate Cloud Firestore and Keap. For the fplowing example, we will use an Android app written with Flutter. The app will provide a login screen to access the Cloud Firestore database. When the user enters the wrong password or username, we will display an error message on the screen. When the user enters the correct password and username, we will display the values stored in the database. The user can edit any of the stored values and save them back to the database.
First, we need to add the dependencies for both Cloud Firestore and Keap. In your pubspec.yaml file, make sure you add them under dependencies:
dependencies. flutter. sdk. flutter firebase_auth. 0.4.0+1 keap. ^0.0.2+1 cloud_firestore. ^0.4.0
We should add the above lines before the other dependencies so that we can add them easier later on. Then we need to add the Cloud Firestore dependency:
flutter. sdk. flutter # The fplowing adds the Cupertino Icons font to your application # Use with the CupertinoIcons class for iOS style icons # use_cupertino_icons. true firebase_auth. 0.4.0+1 keap. ^0.0.2+1 cloud_firestore. ^0.4.0 dependencies. flutter. sdk. flutter firebase_auth. 0.4.0+1 keap. ^0.0.2+1 cloud_firestore. ^0.4.0 dart_to_js_script_rewriter. ^3.0.1+1 web_provider. ^3.0.1+1 path_provider. ^2.0.0 cupertino_icons. ^2.1.11
Next, we need to define our main service class called AppService . It will define all our methods related to the database operations, such as creating new users, logging in users, setting up new records in the database, etc.:
class AppService { Future<AppFuture> getApp(String email. async { var app = await FirebaseAuth .instance .signInAnonymously(. return app .getToken(. .then((token. => { var appId = token .id var provider = new WebProvider(appId); var appFuture = provider .init(context); return appFuture; }. .catchError((error. => ...); } Future<AppFuture> getAppStatus(String email. async { var app = await FirebaseAuth .instance .signInAnonymously(. return app .getToken(. .then((token. => { var appId = token .id; return appId; }. .catchError((error. => ...); } Future<AppFuture> getLoggedUser(String email. async { var app = await FirebaseAuth .instance .signInAnonymously(. return app .getToken(. .then((token. => { var appId = token .id; return appId; }. .catchError((error. => ...); } Future<AppFuture> getUser(String email. async { var credentials = await KeapAuth .instance .loginWithPassword(email, password); return credentials; } Future<AppFuture> createUser(String email, String password. async { var credentials = await KeapAuth .instance .createUserWithPassword(email, password); return credentials; } Future<AppFuture> deleteUser(String email. async { var credentials = await KeapAuth .instance .deleteUserWithEmail(email); return credentials; } Future<AppFuture> updateUser(String email, String password. async { var credentials = await KeapAuth .instance .updateUserWithPassword( email, password ); return credentials; } Future<AppFuture> getRecordFromFirestore(String key. async { var record = await firebaseFirestoreService .listRecordsForPath('/users/' + key); return record[0]; } Future<AppFuture> setRecordInFirestore(String key, String value. async { var record = await firebaseFirestoreService .updateRecordForPath('/users/' + key, value); return record[0]; } Future<AppFuture> loadDataFromFirestore(. async { return await firebaseFirestoreService .readDataFromPath('/users/'); } }
The first method is used to login into the system with an anonymous account from Firebase Auth service using signInAnonymously(. method from Firebase Auth class. This method returns an anonymous token as a response but it is enough for our use case as we are not going to perform any other operation from there other than getting access token from it later on. If you want to do more operations from here then you should consider adding more logic into this method to achieve that goal:
Future<AppFuture> getApp(String email. async { var app = await FirebaseAuth .instance .signInAnonymously(. return app .getToken(. .then((token. => { var appId = token .id var provider = new WebProvider(appId); var appFuture = provider .init(context); return appFuture; }. .catchError((error. => ...); }
The next method is used to sign in via email and password authentication using signIn(. method from Firebase Auth class which returns us an authentication token as a response:
Future<AppFuture> getLoggedUser(String email. async { var app = await FirebaseAuth .instance .signIn({credentialType. 'email'}. return app .getToken(. .then((token. => { var appId = token .id; return appId; }. .catchError((error. => ...); }
The next method is used to sign in via email and password authentication using signIn(. method without signing in anonymously using signInAnonymously(. method from Firebase Auth class which returns us an authentication token as a response:
Future<AppFuture> getUser(String email. async { var credentials = await KeapAuth .instance .loginWithPassword(email, password); return credentials; }
The next method is used to create a new user by calling createUserWithPassword method from KeapAuth class which returns us an authentication token as a response along with user object which contains different properties of user like name , email , etc.:
Future<AppFuture> createUser(String email, String password. async { var credentials = await KeapAuth .instance .createUserWithPassword(email, password); return credentials; }
The next method is used to delete an existing user by calling deleteUserWithEmail method from KeapAuth class which returns us an authentication token as a response along with user object which contains different properties of user like name , email , etc.:
Future<AppFuture> deleteUser(String email. async { var credentials = await KeapAuth .instance .deleteUserWithEmail(email); return credentials; }
The next method is used to update an existing user by calling updateUserWithPassword method from KeapAuth class which returns us an authentication token as a response along with user object which contains different properties of user like name , email , etc.:
Future<AppFuture> updateUser(String email, String password. async { var credentials = await KeapAuth .instance .updateUserWithPassword( email, password ); return credentials; }
The next method is used to get all records from Cloud Firestore using list
The process to integrate Cloud Firestore and Keap may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.
How to Integrate Cloud Firestore with Microsoft Dynamics 365 Business Central?
How to Integrate Cloud Firestore with Deskpro?
How to Integrate Cloud Firestore with Arthur Online?
How to Integrate Cloud Firestore with Nimble?
How to Integrate Cloud Firestore with snovio?
How to Integrate Cloud Firestore with Daylite?
How to Integrate Cloud Firestore with companyHub?
How to Integrate Cloud Firestore with Odoo ERP Self Hosted?