IBM Bluemix mobile backend as a service
This unit covers the following topics:
Introduction to mobile backend as a service (MBaaS)
How does MBaaS work?
Push Notifications service
App ID service
Kinetise service
MobileFirst Services Starter Boilerplate
7.1 What you should be able to do
After completing this unit, you should be able to describe:
IBM Bluemix mobile backend as a service (MBaaS)
The MBaaS architecture
The Push Notifications service
The App ID service
The Kinetise service
How to create IBM Bluemix Mobile applications by using MobileFirst Services Starter Boilerplate
7.2 References
The following publications are useful for further research on the topic presented in this unit:
Mobile Backend Services on Bluemix:
App ID:
Push Notifications:
Kinetise:
How to extend an Android application by using the IBM Push Notifications service on Bluemix:
7.3 What is mobile backend as a service (MBaaS)?
Figure 7-1 What is mobile backend as a service (MBaaS)?
Notes:
With IBM Bluemix mobile backend as a service (MBaaS), you can incorporate pre-built, managed, and scalable cloud services into your mobile applications without relying on IT involvement. By using the complete set of mobile backend services, you can complete the following tasks:
Create your apps faster
Manage push notification subscriptions
Authenticate users
Monitor app usage
Store and sync app data from your client code
Run app logic in the cloud
7.4 IBM Mobile backend services (1 of 2)
Figure 7-2 IBM Mobile backend services (1 of 2)
Notes:
The following IBM mobile services are provided on IBM Bluemix:
App ID
Use the IBM Bluemix App ID service to add authentication to your mobile and web app. App ID supports authentication by using social identity providers, so that users can log in with their Facebook and Google accounts. You can also store user profile information that you can use to build engaging experiences.
Mobile Foundation
The Mobile Foundation service is a scalable IBM Bluemix Mobile access gateway that is powered by the market-leading IBM Mobile Foundation technology. The service offers a comprehensive set of mobile backend capabilities, such as, App lifecycle, Push, Analytics, Feature Toggle, Security and Authentication, and offline synch. It also offers native and Cordova SDKs.
7.5 IBM Mobile backend services (2 of 2)
Figure 7-3 IBM Mobile backend services (2 of 2)
Notes:
Mobile Analytics
Use IBM Mobile Analytics for Bluemix to gain insight into how your app is performing and how it is being used. Monitor performance and usage of all your applications from your desktop or tablet without creating queries or engaging a data analyst. Quickly identify trends and anomalies, drill down to resolve issues, and trigger alerts when key metrics cross critical thresholds.
Push Notifications
Use the IBM Push Notifications for Bluemix service to send and manage mobile push notifications that are targeted to iOS and Android platforms. This service manages the mapping of your application users to their devices, device platform, and handles dispatching push notifications to the devices. By using this service, you can send broadcasts, unicasts (based on userID and deviceID), and tags (or topics) based on push notifications to your mobile application users.
Kinetise
This service enables the rapid development of mobile apps, from idea to prototypes to native apps. Build advanced mobile app by using “drag and drop” editor. It also generates iOS and Android source code.
7.6 MBaaS architecture
Figure 7-4 MBaaS architecture
Notes:
The structure of the APIs that use Node.js runtime and some of the backend services that are provided by IBM Bluemix is shown in Figure 7-4. Also shown is how the different components interact with each other in the mobile environment.
The Mobile App component, which is the front-end component, provides the following services:
Client SDK is used to interact with the server-side components (Node.js runtime and App ID) to provide clients with Google and Facebook authentication.
Push SDK to interact with the device-specific push service providers (iOS and Android only).
Cloudant SDK to implement data persistence with the Cloudant NoSQL database service. It also provides offline data and backend synchronization.
IBM Bluemix component contains the mobile backend services attached to Node.js runtime:
Node.js runtime interacts with external information providers as systems of record and other cloud services.
App ID service interacts with the user identity providers, such as Google and Facebook accounts.
Push Notifications service is configured to access Apple Push Notifications service (APNS) or Google Cloud Messaging (GCM) to send push notifications to mobile devices.
Cloudant NoSQL DB service connects to the Cloudant.com data center to access and manage the database.
7.7 Push Notifications service
Figure 7-5 Push Notifications service
Notes:
You can use the IBM Bluemix Push Notifications service to send push notifications with relevant content to the right people at the right place and time. Push notifications provide a programmable mechanism to send data to mobile devices. The mobile application logic determines how to handle push notifications.
The service provides a unified platform to send and manage mobile push notifications that are targeted to iOS and Android mobile platforms. The service provides the following features:
Manages the mapping of your application users to their devices and device platform
Handles dispatching push notifications to devices
Sends broadcasts, unicasts, (based on deviceID), tag-based, and platform-based as push notifications to your mobile application users
7.8 Push notification process
Figure 7-6 Push notification process
Notes:
As shown in Figure 7-6, a simplified push notification process consists of the following steps:
1. Create an IBM Bluemix application that uses the Push Notification service.
2. The application owner registers with Apple Push Notification Service (or APNS) for Apple devices and with Google Cloud Messaging, now migrated to Google Firebase Cloud Messaging, for Android devices.
3. Configure Push notifications in IBM Bluemix. Here, the credentials from the notification provider are used.
4. Create the mobile application by using IBM Bluemix or outside IBM Bluemix (Android studio or Xcode), that uses the Push Notifications service and APIs.
5. The mobile app calls the IBM Bluemix backend application.
6. The IBM Bluemix application uses the IBM Push API to send and dispatch notifications to the push notification gateway.
7. The push notification gateway sends notifications to the mobile devices.
8. You can send notifications to your app through both providers from a single interface by using the IBM Bluemix Push Notifications service.
7.9 Configuring push notifications in IBM Bluemix
Figure 7-7 Configure push notifications in Bluemix
Notes:
After the application owner registers to use the Google Cloud Messaging or Apple Push Notifications APIs, you can use the credentials that are provided by the push notification provider to configure push notifications in IBM Bluemix.
The use of the App Guid, App Secret, and Client Secret (related to the Push Notification Service) to configure calling the service in the application is shown in Figure 7-7.
You can push your notification to mobile or web-based browsers, such as Google.
7.10 Sending manual notifications from Bluemix
Figure 7-8 Sending manual notifications from IBM Bluemix
Notes:
You can send messages as a push notification to all devices that are subscribed to the push notification or to one of the following specific groups:
Device by Tag: A Tag is a topic that a group of users is following, which is related to the business domain of the mobile application
Device ID
User ID
Android devices
IOS devices
Web notifications
Chrome apps and extensions
Chrome browser
Firefox browser
Safari
You can also use the IBM Bluemix Push Notification Service Rest API to send push messages.
7.11 App ID service
Figure 7-9 App ID service
Notes:
You can add authentication to your mobile application by using the IBM App ID Bluemix service. You can configure client authentication and identity providers so that users can log in to the application by using their Google or Facebook accounts. You can also use the App ID service to protect Node.js and Swift applications that are hosted on IBM Bluemix.
You can also host user profile information that you can use to build engaging user experiences.
App ID features the following components:
Dashboard: Download “Getting started” samples, see activity logs, configure various authentication types and identity providers.
Client SDK: Build mobile and web applications that use the service to implement user authentication. The following platforms are supported:
 – iOS 9+, MacOS 10.11.5, Xcode 8.2
 – Android API 25 or higher, Java 8.x, Android SDK tools 25.2.5 or higher, Android SDK Platform Tools 25.0.3 or higher, and Android Build Tools version 25.0.2
Server SDK
Protect resources that are hosted on IBM Bluemix. At the time of this writing, Node.js and Swift runtimes are supported.
7.12 App ID Authentication options
Figure 7-10 App ID Authentication options
Notes:
You can use the following types of authentication in your mobile application:
Facebook
Users log in to the mobile application by using their Facebook credentials.
To start using Facebook as identity provider, you must create an application in the Facebook Developer Portal to get a Facebook Application ID, which is a unique identifier to let Facebook know which application is attempting to connect.
Google
Users log in to the mobile application by using their Google credentials.
To start using Google as an identity provider, create a project in the Google Developer Console to obtain a Google Client ID. The Google Client ID is a unique identifier for your application used by Google authentication, and is needed for setting up the IBM Bluemix application.
7.13 App ID architecture
Figure 7-11 App ID architecture
Notes:
How the different components of App ID interact with each other is shown in Figure 7-11. Consider the following points:
Use the App ID client SDK to make a request to your back-end resources that are protected with the App ID server SDK.
The App ID server SDK detects an unauthorized request and returns an HTTP 401 and authorization scope.
The client SDK automatically detects the HTTP 401 and starts the authentication process.
When the client SDK contacts the service, the server SDK returns the login widget if more than one identity provider is configured. App ID calls the identity provider and presents the login form for that provider, or returns a grant code that allows them to authenticate if no identity providers are configured.
App ID requests the client application to authenticate by supplying an authentication challenge.
If Facebook or Google are configured and the user logs in, the authentication is handled by the respective identity provider OAuth Flow, which is an authorization framework that enables a third-party application to obtain limited access to an HTTP service.
If the authentication ends with the same grant code, the code is sent to the token endpoint. The endpoint returns two tokens: An access token (for proving user’s authorization to the resource) and an identity token (for proving authentication of the user).
From this point on, all requests that are made with the client SDK have a newly obtained authorization header.
The client SDK automatically resends the original request that triggered the authorization flow.
The server SDK extracts the authorization header from the request, validates the header with the service, and grants access to a back-end resource.
7.14 What is Kinetise?
Figure 7-12 What is Kinetise?
Notes:
Kinetise is a codeless mobile applications development suite with which users can create even the most advanced applications in less than 24 hours.
A web-based “drag and drop” editor enables rapid prototyping, connecting to APIs, and creating fully-functional native iOS and Android builds.
To start, select Kinetise service from your dashboard and then, click OPEN KINETISE DASHBOARD.
7.15 How to use Kinetise
Figure 7-13 How to use Kinetise
Notes:
Applications that are built by using Kinetise can connect to any JSON or XML-based RESTful API. IBM Bluemix-related examples include Cloudant NoSQL DB or APIs that are defined in API Connect service.
Data can be retrieved, displayed, and sent out based on the user input. Kinetise allows you to create applications with user authentication so that the data that is processed by the application is personalized and secured.
The integration point between Kinetise and other IBM Bluemix services occurs by means of API URLs and request parameters that can be fully configured in the Kinetise editor.
For more information about tutorials and samples of integrating mobile applications that are built in Kinetise with IBM Bluemix services and applications, see the following website:
7.16 MobileFirst Services Starter Boilerplate
Figure 7-14 MobileFirst Services Starter Boilerplate
Notes:
You can use all of the IBM Bluemix Mobile services together by using Bluemix IBM MobileFirst Services Starter Boilerplate, or you can use individual services from the IBM Bluemix catalog.
You can also use individual services if you want a different type of runtime for the back-end application rather than Node.js, or if you do not want to use all the services that are included with the Boilerplate.
The MobileFirst Services Starter Boilerplate is a template that features a runtime and a set of services to develop, deploy, and scale server-side JavaScript applications with ease. It includes the following features:
App ID service
Push notifications service
Cloudant NoSQL DB service
SDK for Node.js runtime
7.17 Unit summary
 
Figure 7-15 Unit summary
7.18 Checkpoint questions
Figure 7-16 Checkpoint questions
 
7.19 Checkpoint answers
Figure 7-17 Checkpoint answers
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.105.2