IBM Bluemix Mobile Backend as a Service
This unit covers the following topics:
Introduction to Mobile Backend as a Service
How does MBaaS work?
Push Notifications service
Mobile Client Access service
Mobile Quality Assurance service
MobileFirst Services Starter Boilerplate
7.1 What you should be able to do
After completion of this unit, you should be able to:
Describe Bluemix Mobile Backend as a Service (MBaaS)
Describe the MBaaS architecture
Describe the IBM Push Notifications service
Describe the Mobile Client Access service
Describe the Mobile Quality Assurance service
Describe how to create 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
Mobile Client Access
Push Notifications
Mobile Quality Assurance
How to enhance mobile application security with Bluemix Mobile Services
Part 1:
Part 2:
How to protect your application using Mobile Client Access
How to extend an Android app 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, you can incorporate pre-built, managed, and scalable cloud services into your mobile applications without relying on IT involvement. Using the complete set of mobile backend services, you can accomplish these objectives:
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 Bluemix:
Mobile Client Access service: Use the IBM Mobile Client Access for Bluemix service to add security functionality to your mobile app. You can configure client authentication and identity providers so that users can log in to the app with their existing Google or Facebook accounts.
Mobile Foundation: Use the IBM Mobile Foundation for Bluemix service to expedite setting up an IBM MobileFirst Platform Foundation environment. IBM MobileFirst enterprise mobility solutions deliver a complete environment to develop apps and enable engagements that are designed specifically for mobile users.
7.5 IBM Mobile backend services (2 of 2)
Figure 7-3 IBM Mobile backend services (2 of 2)
Notes:
Mobile Quality Assurance
Use the IBM Mobile Quality Assurance for Bluemix service to discover and set up mobile quality services for your apps. You can view high-level quality metrics for your mobile apps to get a quick understanding of the issues for apps that you are working on. These metrics include information for crashes, bugs, user feedback, and user sentiment. By viewing this information for your apps, you can determine whether to investigate specific issues further.
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. With 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.
Mobile Application Content Manager
IBM Mobile Application Content Manager for Bluemix provides a consistent and easy content authoring experience with a workflow process for content approval. It merges the goals of the content authors, reviewers, content managers, and mobile application developers to create a simplified, cloud-based authoring experience.
7.6 MBaaS architecture
Figure 7-4 MBaaS architecture
Notes:
The diagram shows the structure of the APIs using Node.js runtime and some of the backend services provided by Bluemix. It shows how the different components interact with each other in the mobile environment.
The Mobile App component, which is the front-end component, provides these services:
Core SDK is used to interact with the server-side components (Node.js runtime and Mobile Client Access) to provide clients with Google+ and Facebook authentication as well as a custom Authentication provider.
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.
Bluemix component contains the mobile backend services attached to Node.js runtime:
Node.js runtime interacts with external Information providers such as systems of record and other cloud services.
Mobile Client Access service interacts with the user identity providers such as Google and Facebook accounts or other Identity providers.
Push Notifications service must be 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 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 Bluemix Push Notifications service provides a unified platform to send and manage mobile Push Notifications that are targeted to iOS and Android mobile platforms. The Push Notifications service provides these 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), and also tags (or topics) as push notifications to your mobile application users
7.8 Push notification process
Figure 7-6 Push notification process
Notes:
A simplified push notification process is described here:
1. Create a 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 Bluemix. Here you use the credentials that you get from the notification provider.
4. Create the mobile client app that uses the IBM Push Notifications service and APIs.
5. The mobile app calls the Bluemix backend application.
6. The 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. Now you can send notifications to your app through both providers from a single interface using the Bluemix Push Notifications service.
7.9 Configure push notifications in 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 Bluemix.
The slide shows an example that uses the Application Route and Application GUID (both related to the Push Notifications service) to configure calling the service in the application. This configuration is shown in detail in Exercise 6 of this course.
7.10 Send manual notifications from Bluemix
Figure 7-8 Send manual notifications from Bluemix
Notes:
You can also send messages to a user or group by Platform, User ID, Device ID or Tag. A Tag is a topic that a group of users is following, related to the business domain of the mobile app.
You can also use the Bluemix Push Notifications service Rest API to send Push messages.
7.11 Push notification message
Figure 7-9 Push notification message
Notes:
The figure shows a push notification dialog box as seen in an Android device emulator running in the Android Studio environment. You can use an emulator when you develop a mobile app to enable application development and test on multiple platforms. Android Studio is the most popular IDE for Android platform application development.
The dialog box displays the text of the push notification that was sent from the Notification tab of the Bluemix IBM Push service.
7.12 Mobile Client Access (MCA) service
Figure 7-10 Mobile Client Access (MCA) service
Notes:
You can add security to your mobile app with the IBM Mobile Client Access for Bluemix service. You can configure client authentication and identity providers so that users can log in to the app with their existing Google or Facebook accounts. You can also use the Mobile Client Access service to protect Node.js and Liberty for Java applications that are hosted on Bluemix with various authentication types.
Mobile Client Access includes these components:
Dashboard
Configure various authentication types and monitor mobile application performance, analytics, usage statistics, and device logs.
MCA Client SDK
Instrument mobile applications to use Mobile Client Access functionality. Supported platforms are: iOS 8 and later, Android 4 and later, and Cordova.
MCA Server SDK
Protect resources that are hosted on Bluemix. Currently, supported runtimes are Node.js and Liberty for Java.
7.13 Mobile Client Access Authentication options
Figure 7-11 Mobile Client Access Authentication options
Notes:
You can use the following types of authentication in your mobile app:
Facebook
 – Your users log in to the mobile app with 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
 – Your users log in to the mobile app with 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 the Bluemix application.
Custom
 – Use the IBM Mobile Client Access for Bluemix service and implement your own logic for collecting and validating credentials.
 – A custom identity provider is a web application that exposes a REST API. You can host the custom identity provider on premises or on IBM Bluemix.
 – The only requirement is that the custom identity provider must be accessible from the public internet so that it can communicate with the Mobile Client Access service.
7.14 Mobile Client Access (MCA) architecture
Figure 7-12 Mobile Client Access (MCA) architecture
Notes:
This slide shows how the different components of Mobile Client Access interact with each other:
Protect your cloud resources (Node.js or Liberty for Java applications) with Mobile Client Access Server SDK.
Use Request class provided by the Mobile Client Access Client SDK to communicate with your protected cloud resources.
The Mobile Client Access Server SDK detects an unauthorized request and returns an HTTP 401 authorization challenge.
Mobile Client Access SDK detects the HTTP 401 Authorization challenge and automatically starts the authentication process with the Mobile Client Access service.
Facebook, Google, or Custom authentication is attempted.
After successful authentication, Mobile Client Access returns an authorization token.
The Mobile Client Access SDK automatically adds the authorization token to the original request, and re-sends the request to the cloud resource.
The Mobile Client Access Server SDK extracts the access token from the request and validates it with the Mobile Client Access service.
Access is granted. The response is returned to the mobile application.
7.15 Mobile Quality Assurance features
Figure 7-13 Mobile Quality Assurance features
Notes:
Use IBM Mobile Quality Assurance for Bluemix to discover and set up mobile quality services for your apps. You can view high-level quality metrics for your mobile apps to get a quick understanding of the issues for the apps that you are working on. These metrics include information for crashes, bugs, user feedback, and user sentiment. By viewing this information for your apps, you can determine whether to investigate specific issues further. For example, if the crash rate for an app spikes, you can click the crash rate to view more detailed information about crash reports for that app.
Mobile Quality Assurance helps you to accomplish these tasks:
Create, manage, and run an efficient mobile beta program. Recruit prospective beta users, customize beta programs, and continuously engage with beta participants.
Submit defects and provide feedback in seconds while using the application from your mobile device.
Add screen shots and in app screen videos.
Capture tester and live user experience to continuously build and deliver high quality mobile apps.
Automated crash reporting.
Get aggregated crash logs from pre-production and production environments automatically.
User feedback and sentiment analysis.
Get feedback about your app straight from your customers through APIs, and mine app ratings and reviews to extract actionable insights.
Bug Tracking System Integrations.
Plug Mobile Quality Assurance into your existing test flow by integrating with a wide variety of bug tracking systems. (for example IBM Rational Team Concert™, JIRA Software, Microsoft Team Foundation Server Bug Tracking, GitHub, Bugzilla, Rally)
7.16 Mobile Quality Assurance window
Figure 7-14 Mobile Quality Assurance window
Notes:
The slide shows the following information displayed in the Mobile Quality Assurance GUI:
Number of Sessions for Preproduction and Production builds for a demo app on iOS.
For preproduction sessions, 10 sessions with crashes, 10 with bugs, and 0 with feedback.
From this GUI you can upload builds, show app key, distribute to test and configure integrations.
7.17 Getting started with Mobile Quality Assurance
Figure 7-15 Getting started with Mobile Quality Assurance
Notes:
Complete these steps to get started with Mobile Quality Assurance:
1. Add a mobile app to the Mobile Quality Assurance service.
 
Important: Mobile apps in the Mobile Quality Assurance service represent actual mobile apps running on the users’ devices. They are not the same as Bluemix backend applications. Therefore, you will not be billed on number of apps running or memory used because they are not running on Bluemix datacenters. However, you will be billed based on the number of Mobile Quality Assurance services that you are consuming.
2. Prepare the app for reporting:
a. Add platforms (Android or iOS).
b. Download and install libraries for the selected platforms. Each mobile app platform gets an app key.
c. Use the downloaded SDK and app key to instrument your app.
3. From the Bluemix service user interface, view reports related to Crashes, Bugs, Feedback, and Sentiment score.
7.18 MobileFirst Services Starter Boilerplate
Figure 7-16 MobileFirst Services Starter Boilerplate
Notes:
You can either use all of the Bluemix Mobile services together by using Bluemix IBM MobileFirst Services Starter boilerplate, or you can use individual services from the Bluemix catalog. You can use individual services if you want a different type of runtime for the backend app rather than Node.js, or if you do not want to use all the services which come with the Boilerplate.
 
Note: Exercise 5 highlights the use of the Node.js backend app with the MobileFirst Services Starter Boilerplate.
The MobileFirst Services Starter Boilerplate contains these features:
A Mobile Client Access service.
A Push Notifications service.
A Cloudant NoSQL DB service.
SDK for Node.js runtime.
7.19 Exercise 5 objectives
Figure 7-17 Exercise 5 objectives
Notes:
After completing this exercise, you should be able to:
Create a MobileFirst Services Starter application on Bluemix.
Set up the Android development environment.
Clone the mobile application from IBM Bluemix DevOps.
Configure the front-end mobile app.
Install the Android virtual device.
Run the Android application on a mobile emulator.
 
7.20 Exercise 6 objectives
Figure 7-18 Exercise 6 objectives
Notes:
After completing this exercise, you should be able to:
Create a MobileFirst Services Starter application on Bluemix.
Configure Google Cloud Messaging Service.
Configure Bluemix Push Notifications service.
Clone the mobile application from Github.
Configure the front-end mobile app.
Run the Android application on a mobile device emulator.
Send push notifications from Bluemix and receive them on the mobile device emulator.
 
7.21 Checkpoint questions
Figure 7-19 Checkpoint questions
Notes:
(none)
7.22 Checkpoint answers
Figure 7-20 Checkpoint answers
Notes:
(none)
..................Content has been hidden....................

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