BaaS (Backend as a Service) also known as MBaaS (Mobile Backend as a Service) allows connecting mobile (and also desktop) applications to cloud services.
Use the REST BaaS framework to connect with Kinvey or Parse BaaS providers in order to:
- Create, retrieve, update and delete objects.
- Signup, login, retrieve, update and delete users.
- Upload, download and delete files or streams.
- Query objects and users.
- Send push notifications.
- Register for and receive push notifications on a device.
Getting Started with BaaS Providers
To be able to work with Kinvey and Parse as BaaS providers, you need to create an account. Then, to add this service to your applications, you need to create an app with the backend provider:
- Getting Started with Kinvey and Parse
BaaS Account Information
Once you have created an app with the BaaS provider, Kinvey and Parse provide you with some keys that you need to add in the Kinvey provider component and Parse provider component of your Appmethod application.
|Kinvey key name||Property|
|App Key (or App ID)||TKinveyProvider.AppKey|
|Parse key name||Property|
|REST API Key||TParseProvider.RestApiKey|
The REST.Backend API provides a set of components to work with Kinvey and Parse to manage things such as users, storage, files, queries, push notifications and events.
The REST.Backend components support BaaS services in a general or abstract way. The code you write using this components is not specific to Kinvey or Parse. For example, when you use the TBackendStorage component to create an object, the code is the same whether you are creating a Kinvey object or a Parse object.
The REST Backend components depend on backend service implementations to make the calls to Kinvey or Parse. For example, there is a Kinvey storage service which can be used by the TBackendStorage component.
To create a BaaS application, you should include a provider component such as TKinveyProvider or TParseProvider with the appropriate connection information for the Cloud service supplied by the BaaS provider. To connect a provider component with a service component you must indicate the provider component in the Provider property of the service component, such as TBackendStorage.Provider. The below tables show the BaaS Provider Components and the Service Components:
|BaaS Provider Component||Description|
|TKinveyProvider||Kinvey BaaS provider, component that contains the information about the Kinvey could service connection|
|TParseProvider||Parse BaaS provider, component that contains the information about the Parse could service connection.|
|TBackendStorage||Use this component to create, retrieve, update and delete objects.|
|TBackendUsers||Use this component to perform user actions such as: sign up, log in, retrieve, update or delete users.|
|TBackendFiles|| Use this component to upload and delete files or streams. |
Note: This component does not download files. Use the REST class TDownloadURL to download files.
|TBackendQuery|| Use this component to query object, users and other types.
Note: Different service implementation may support queries on different types. For example, the Kinvey service implementation can query files and Parse implementation cannot.
|TBackendAuth||Use this component to manage user authentication such as log in and sign up.|
|TBackendPush||Use this component to send push notifications.|
|TPushEvents||Use this component to listen for push notifications messages.|
These units declare methods that map directly onto the REST API of the BaaS supplier. Use these units to write code to call REST API endpoints in Kinvey or Parse. The code you write using these units will be specific to Parse or Kinvey.
Check the below tables to see the REST.Backend methods you may use, as well as the resources and verbs used.
Methods from REST.Backend.KinveyApi:
- Note: The resources of the above table refer to the following: AppData is data stored in the cloud, Blob are files (such as images, video and other), User is user and Push is push notification.
Methods from REST.Backend.ParseApi:
- Note: The resources of the above table refer to the following: Classes are objects, Installation is an instance of the app being installed on a device, Push is push notification, Files are files and Users are users.
You may also check the API documentation from the BaaS providers:
Some BaaS components have support for Visual LiveBindings, so you can use the LiveBindings Designer to connect properties of the components to controls of your form.
|Property||Value||Typical binding control|
|TBackendQuery.JSONResult||Result of the query (TJSONArray).||TMemo|
|TBackendQuery.BackendClassName||Collection or Class name when querying storage.||TEdit|
|TBackendQuery.BackendService||What to query: Storage, Users, Installations, Files, and so on.||TEdit|
|TBackendQuery.QueryStrings||Query strings. The strings must be valid for the particular cloud service.||TMemo|
|TBackendPush.GCM.Action||Action field of the push message (Android).||TEdit|
|TBackendPush.APS.Badge||Badge field (iOS).||TEdit|
|TBackendPush.APS.Sound||Sound field (iOS).||TEdit|
|TBackendPush.GCM.Title||Title field (Android).||TEdit|
|TPushEvents.JSONResult||JSON array of all messages that have been received.||TMemo|
|TPushEvents.Active||Listen for push messages.||TCheckBox|
- Getting Started with Kinvey and Parse
- Managing BaaS Users
- Using BaaS for Backend Storage
- Using BaaS to Send Push Notifications
- BaaS Tutorials: