Category Archives: iOS

IBM MobileFirst – Powering the IBM & Apple Partnership

Back in July, Apple and IBM announced a global strategic partnership to redefine how enterprises use mobile applications. Well, last week IBM and Apple announced the first set of apps developed from this partnership.

ibm-apple

The first set of applications include industry-specific applications designed to “redefine how work gets done”. The first set includes apps for air travel, banking and finance, insurance, government, retail, and telecom industries, and are just the beginning of the IBM/Apple parnership. Check out the press release for full details on the apps.

Apple’s VP of Worldwide Marketing, Phil Schiller is quoted saying: “The business world has gone mobile, and Apple and IBM are bringing together the world’s best technology with the smartest data and analytics to help businesses redefine how work gets done.”

So what is powering this transformation?  

The IBM MobileFirst Platform. That’s what.

MobileFirst-Logo

From the press release:


To supplement the IBM MobileFirst for iOS apps, the partnership between Apple and IBM offers business customers additional levels of capability integrated for enterprise mobility, including:

  • Mobile Platform and Enterprise Integration – Leveraging IBM’s global industry consulting expertise, client experience design and enterprise systems integration from analytics, workflow and cloud storage, to fleet-scale device management, security and integration. Enhanced mobile management includes a private app catalog, data and transaction security services, and productivity suite for all IBM MobileFirst for iOS solutions. In addition to on-premise software solutions, all these services will be available on Bluemix—IBM’s development platform on the IBM Cloud Marketplace.
  • Supply, activate and manage – Streamlined end-to-end procurement, deployment and lifecycle management — at scale; along with cloud solutions for enterprise security, device management, and data and process integration. IBM Global Financing leasing options and services to allow organizations to keep pace with latest device releases.
  • AppleCare for the Enterprise  – Providing IT departments and end users with 24/7 assistance for their devices from Apple’s award-winning customer support group, with on-site service delivered by IBM.

So, what does this mean from a more detailed/technical perspective?

MobileFirst Platform Foundation

Let’s look at the MobileFirst Platform Foundation, which consists of MobileFirst Platform Server (console and app management), client-side SDKs for native or hybrid apps, the MobileFirst Studio & CLI tools, and the MobileFirst Application Center.

mobilefirst-architecture
MobileFirst High-level System Architecture

The MobileFirst Platform Server and Client-side SDKs deliver security features, data integration features, app management features, unified push notifications, and analytics. From the security perspective, the MobileFirst server and SDK provide user authentication and can integrate with virtually any single-sign-on or identity management provider, and can maintain user authentication across multiple applications.

mfp-sso
Multi-app Single Sign On

The MobileFirst SDK also enables encrypted on-device storage, which can be synched with MobileFirst data adapters (used to expose data to the mobile applications).

For application management, the MobileFirst platform enables you to track versions of an app that are live out in production. From the server console, you can send messages to specific versions of an application, or remotely lock down specific versions of an app. This could be used to force compliance using the latest version of an app, or could be used to lock down an app due to some sort of security issue. You can read more about strategies for managing app versions on the MobileFirst platform here.

Application Management Console
Application Management Console

For data integration, the MobileFirst platform enables developers to leverage data adapters, which are lightweight server-side functions to data in a mobile-friendly format. They can automatically generate JSON objects from database information, leverage server-side compression to reduce network latency, perform object translation to compress large structures into smaller, less verbose packages (IE: SOAP to JSON, etc…).

worklight-adapters
MobileFirst Data Adapters

 

Usage of these data adapters is automatically audited, and is governed by the SDK’s authentication and app management. Server-side developers will be happy to know that data adapters are easy to develop using server-side JavaScript. Client-side developers will be happy to know that the MobileFirst SDK has a consisent client-side API to call any backend system.

The MobileFirst Platform server automatically exposes operational analytics for every app and data adapter managed through the platform. This provides insight into devices/platforms/OS versions that are consuming your applications, server-side collection of client-side app logs, and data adapter usage, all enabled “out of the box”.

MobileFirst Platform Analytics
MobileFirst Platform Analytics

MobileFirst Application Center

The MobileFirst Application Center is reposity of mobile applications that enables an “out of the box” app store for your enterprise. If facilitates the sharing of mobile applications, and enables sharing of feedback and rating information. It also uses access control lists to limit who might be able to install specific applications. If your enterprise has numerous mobile apps, and you need a way to manage distribution of your enterprise-signed iOS apps, then this is the solution for you.

mf-application-center
MobileFirst Application Center

MobileFirst Platform Application Scanning

MobileFirst Platform Application Scanning is set of tools that can scan your JavaScript, HTML, Objective-C, or Java code for security vulnerabilities and coding best practices. Think of it as a security layer in your software development lifecycle.

MobileFirst Quality Assurance

MobileFirst Quality Assurance is a set of tools and features to help provide quality assurance to your mobile applications. It includes automated crash analytics, user feedback and sentiment analysis, in-app bug reporting, over-the-air build distribution to testers, test/bug prioritization, and more.

MobileFirst Protect

MobileFirst Protect is a comprehensive suite of tools that enables an enterprise to manage, virtualize and optimize devices, networks, and apps. This includes Mobile Application Management (MAM), Mobile Device Management (MDM), and Mobile Network Performance Management (MNPM). Take a look at the quick video to see how MobileFirst Protect can help you secure the devices connecting to your enterprise.

 MobileFirst Engage

MobileFirst Engage is a platform that enables you to add analytics to your mobile applications. This can help you identify and understand how users are interacting with your enterprise. You can track mobile engagement, process the data, and provide a contextually relevant experience to your users in realtime.

The IBM MobileFirst Platform provides unparalleled tools to build, manage and monitor reliable and secure applications, manage and secure devices, monitor usage and drive engagement, and bring your enterprise to a mobile reality.

IBM Bluemix Cloud Services

Of course, let’s not forget IBM Bluemix, IBM’s suite of cloud services.  Bluemix covers everything from mobile app integration, business process & workflow, security services, cloud storage, analytics, and even the IBM Watson cognitive platform.  This post is long enough already, so I’ll go into more detail on Bluemix at a later date, but definitely go check it out.  There’s everything from basic node.js or Java server hosting, to app boilerplates/templates, and more.

IBM BlueMix Services
IBM BlueMix Services

 

UX & Mobile Apps Leveraging the IBM MobileFirst Platform

When you are developing a mobile app (or website, or mobile web, or TV app, etc..) you should always ask yourself “What kind of an impact does this have on the end user?” It doesn’t matter whether you are creating enterprise apps or games, or anything in between. Every development decision that you make should be weighed upon it’s impact to the overall impact it has on the end user. Simply put: if your app sucks, nobody is going to want to use it.

When building mobile apps using IBM MobileFirst you have two options for a user interface layer; you can write a native app, or you can write a hybrid app using HTML, CSS, & JavaScript.

Native VS HTML Hybrid

So, what kind of an impact does the addition of IBM MobileFirst have on the app?

NONE, granted the app’s UX can vary depending upon whether you are developing a native app or a hybrid app.

IBM MobileFirst Platform Foundation is a platform that consists of a server tier and client-side SDK. If you are developing a native app, the SDK/API provides access to MobileFirst platform features, like user authentication, app version management, data access through adapters, encrypted storage, unified push notification, remote log collection, and more. If you are developing a hybrid app, the app’s UX must be developed complete inside of the web view container. The MobileFirst Foundation SDK provides additional functionality just like mentioned above for the native SDK, plus a few classes that enable native dialogs and a few native UI elements, but for the most part, there is very, very minimal impact on the user’s experience.

When building any kind of mobile app, regardless of whether it is native or hybrid, you need to pay attention to what the user experiences. Are you following human interaction or design guidelines for the platform? Are you forcing your user to go through unnecessary or redundant steps? Are you making forms more complex than they need to be? Are you forcing multiple taps for a simple interaction? Can things be simplified?

The IBM MobileFirst Platform does not add any additional overhead for UX processes.

The IBM MobileFirst platform can be used to develop native apps on iOS, Android, Windows Phone, or Java ME platforms. Follow native coding conventions and UX guidelines for each individual platform. Make sure you follow these guidelines, otherwise your app may feel alien within the ecosystem, or may be rejected from app store approval altogether.

What should you think about when building a hybrid app leveraging IBM MobileFirst?

First, it depends on your hybrid approach. If you are using the for Xamarin hybrid approach for MobileFirst apps, then your considerations will be much like writing a native app.

If you are using the HTML/CSS/JavaScript approach (leveraging the Apache Cordova container), then you really want to focus on the user’s experience inside of the HTML container. You want to make sure the UI feels like “an app”, not like “a web page”. There are many client-side frameworks that help address this need. Feel free to use any of them, or roll your own – just keep the UX/human interaction guidelines in mind.

(this is by no means an exhaustive list, there are more out there)

Make sure you’re building for touch interactivity, addressing animations correctly to minimize browser reflow operations, and more… Read this post on Dzone that I wrote last year for a lot more detail on performance considerations for hybrid or mobile web apps.

If you are using any of these (or none of these), also don’t forget an architectural pattern/framework for helping keep your code organized and consistent. Read this post on hybrid/web app architectural patterns and considerations for even more detail.

For both native and hybrid approaches, you also want to consider impacts of perceived performance vs actual raw processing  power. These techniques deliver the appearance that the app is fast and responsive, instead of sluggish or locked while waiting to perform an action. Perceived performance improvements can be achieved simply by providing instant feedback, performing animations during an asynchronous request, or preemptive tasking. Don’t miss this post, where I go into perceived performance in mobile apps in great detail.

 

Strategies for Managing App Versions & Updates With IBM MobileFirst Foundation (aka Worklight)

IBM MobileFirst Foundation provides two mechanisms to manage app versions and updates.  Neither requiring you to write any additional code!

The first is app versioning; MobileFirst Foundation tracks each version of an app that you deploy, and gives you the ability govern or restrict access to specific platforms and versions. App versioning applies to all apps, native or hybrid, on any platform that MobileFirst Foundation supports. The second is Direct Update, which allows you to push new HTML/CSS/JavaScript (web) resources to a MobileFirst hybrid app. Direct Update only applies to hybrid apps, but it works for any platform that MobileFirst supports.

App Version Management

When you deploy an app to the MobileFirst Foundation server, the server will automatically track versions based on the version number specified in you application-descriptor.xml file.

Set Application Version
Set Application Version

When you load the MobileFirst Foundation Server Console, you’ll be able to view all of the deployed app platforms and versions.

The screenshot below shows a hybrid app deployed for both Android and iOS platforms. You would also be able to see the exact same version and platform information for native apps that leverage IBM MobileFirst Foundation.

Managing Versions in the MobileFirst Console (click to enlarge)
Managing Versions in the MobileFirst Console (click to enlarge)

You’ll notice in the MobileFirst console that next to each platform/version you can set the status for that version. This makes it possible to set notification messages for users on specific platforms and versions, or even restrict access to specific platforms and versions.

For example, look at the screenshot above… Version 1.0 on Android is active. Version 1.2 on iOS is active. Version 1.1 on iOS is notifying, and Version 1.0 on iOS is disabled.

There are 3 statuses that can be set for each platform and version combination.: Active, Active Notifying, and Access Disabled.

Set Platform/Version Status
Set Platform/Version Status

When you set the status of a platform/version, this status is only for that specific platform/version pair. This enables you to selectively notify users of specific versions, or even block access to specific versions if they are outdated and no longer supported.

“Active” means that the application is active. Services to this version will operate normally, and no messages will be presented to the user.

“Active Notifying” means that the application is active, services will continue to work, but a message will be presented to the user when the app becomes active, or when a service request is made to the MF server.

Setting Active Notification Message
Setting Active Notification Message

This can be used to send any text-based message to the app users. This could be a deprecation notice, service maintenance notice, or any other general notice.

Within the app, the user will see a message when the app becomes active, or when a request is made to the server. This message can be dismissed, and the app functionality is not impacted in any way.

In-App Active Notification Experience
In-App Active Notification Experience

“Access Disabled” means that access to the application is disabled. In this state, a notification message will be presented to the user, and access from the app version will be disabled. The user will also be presented with an “Upgrade” button, which will redirect the user to any URL, which presumably will be for an updated version of the app.

Setting Disabled Status
Setting Disabled Status

In this state, the app will not be granted access to the MobileFirst/Worklight server. So, if your app requests data from a data adapter, all requests to the adapter from this platform/version will be blocked. If your app initialization code is inside of the Worklight client’s connect:onSuccess handler, then this can prevent your app from loading at all.

In-App Disabled Experience
In-App Disabled Experience

Again, When you set the status of a platform/version, this status is only for that specific platform/version pair.

You can learn more about managing applications through the MobileFirst/Worklight Console using the Administering Worklight applications with Worklight Console online documentation.

Direct Update

MobileFirst hybrid applications leverage Apache Cordova plus MF-specific APIs as a foundation to deliver hybrid apps. Apache Cordova enables developers to build natively-installed cross platform apps using web technologies.

Direct Update is a feature for MobileFirst hybrid apps, which enables you to push updated app content (HTML, CSS, & JavaScript) without the user having to deploy a new version of the app through the app store.

Direct Update is considered an additional security feature b/c it enforces users to use the latest version of the application code. However, when an app uses Direct Update, it *only* updates the web resources.  No native changes or version # changes will be applied. However, it should not be abused. In particular this will bypass the Apple’s app store approval process. You should not overhaul the entire UI and break Apple’s Human Interaction Guidelines, otherwise you could be kicked out of the app store.

Direct Update User Experience
Direct Update User Experience

By default, the update’s user experience is a modal overlay that shows download and installation progress. The updater’s UX can be configured to use silent updates that do not block the user’s experience, can be a completely custom user experience, or can be disabled altogether.  Updates can also be paused or resumed using the JavaScript API so that it does not block the user from performing a critical task, however this would require a custom UI – the default UI does not enable pause/resume.

Updates in the current version of Worklight (6.2) are complete updates containing the entire application (www) code, however MobileFirst Foundation 6.3 (coming this month) will have a Differential Direct Update feature that includes only the changed files. More detail will be posted once this is available.

Direct Update can also be disabled if you don’t want your hybrid apps to update automatically.

For more information on Direct Update, be sure to check out these additional resources:

Additional note:  If you’re wondering by I interchange MobileFirst and Worklight in this post, it’s because Worklight is now MobileFirst Platform Foundation

So, What is IBM MobileFirst?

I’m still “the new guy” on the MobileFirst team here at IBM, and right away I’ve been asked by peers outside of IBM: “So, what exactly is MobileFirst/Worklight?  Is it just for hybrid apps?”

In this post I’ll try to shed some light on IBM MobileFirst, and for starters, it is a lot more than just hybrid apps.

MobileFirst-Logo

IBM MobileFirst Platform is a suite of products that enable you to efficiently build and deliver mobile applications for your enterprise, and is composed of three parts:

IBM MobileFirst Platform Foundation

IBM MobileFirst Platform Foundation (formerly known as Worklight Foundation) is a platform for building mobile applications for the enterprise.  It is a suite of tools and services available either on-premise or in the cloud, which enable you to rapidly build, administer, and monitor secure applications.

The MobileFirst Platform Foundation consists of:

  1. MobileFirst Server – the middleware tier that provides a gateway between back-end systems and services and the mobile client applications.  The server enables application authentication, data endpoints/services, data optimization and transformation, push notification management (streamlined API for all platforms), consolidated logging, and app/services analytics. For development purposes, the MobileFirst server is available as either part of the MobileFirst Studio (discussed below), or as command line tools.

  2. MobileFirst API - both client and server-side APIs for developing and managing your enterprise mobile applications.
    • The server-side API enables you to expose data adapters to your mobile applications – these adapters could be consuming data from SQL databases, REST or SOAP Services, or JMS data sources. The Server side API also provides a built-in security framework, unified push notifications (across multiple platforms), and data translation/transformation services. You can leverage the server-side API in JavaScript, or dig deeper and use the Java implementation.
    • The client-side API is available for native iOS (Objective-C), native Android (Java), J2ME, C# native Windows Phone (C#), and JavaScript for cross-platform hybrid OR mobile-web applications. For the native implementations, this includes user authentication, encrypted storage, push notifications, logging, geo-notifications, data access, and more.  For hybrid applications, it includes everything from the native API, plus cross-platform native UI components and platform specific application skinning.  With the hybrid development approach, you can even push updates to your applications that are live, out on devices, without having to push an update through an app store.  Does the hybrid approach leverage Apache Cordova?  YES.

  3. MobileFirst Studio - an optional all-inclusive development environment for developing enterprise apps on the MobileFirst platform.  This is based on the Eclipse platform, and includes an integrated server, development environment, facilities to create and test all data adapters/services, a browser-based hybrid app simulator, and the ability to generate platform-specific applications for deployment.  However, using the studio is not required! Try to convince a native iOS (Xcode) developer that they have to use Eclipse, and tell me how that goes for you… :)  If you don’t want to use the all-inclusive studio, no problem.  You can use the command line tools (CLI).  The CLI provides a command line interface for managing the MobileFirst server, creating data adapters, creating the encrypted JSON store, and more.

  4. MobileFirst Console – the console provides a dashboard and management portal for everything happening within your MobileFirst applications.  You can view which APIs and adapters have been deployed, set app notifications, manage or disable your apps, report on connected devices and platforms, monitor push notifications, view analytics information for all services and adapters exposed through the MobileFirst server, and manage remote collection of client app logs.  All together, an extremely powerful set of features for monitoring and managing your applications.

  5. MobileFirst Application Center - a tool to make sharing mobile apps easier within an organization.  Basically, it’s an app store for your enterprise.

MobileFirst Platform Application Scanning

MobileFirst Platform Application Scanning is set of tools that can scan your JavaScript, HTML, Objective-C, or Java code for security vulnerabilities and coding best practices.  Think of it as a security layer in your software development lifecycle.


MobileFirst Quality Assurance

MobileFirst Quality Assurance is a set of tools and features to help provide quality assurance to your mobile applications.  It includes automated crash analytics, user feedback and sentiment analysis, in-app bug reporting, over-the-air build distribution to testers, test/bug prioritization, and more.


So, is MobileFirst/Worklight just for hybrid (HTML/JS) apps? You tell me… if you need clarification more information, please re-read this post and follow all the links.  ;)

 

IBM Worklight Powered Native Objective-C iOS Apps

IBM MobileFirst Foundation (also known as IBM Worklight) is a middleware solution for developing mobile applications. Out of the box, Worklight enables security and authentication, device management, encrypted storage, operational analytics, simple cross platform push notifications, remote logging, data access, and more…

Historically, most people think that Worklight is just for creating hybrid mobile (HTML-powered) applications. While this is one of the powerful workflows that Worklight enables, it’s also the proverbial “tip of the iceberg”. Worklight does a lot more than just provide the foundation for secure hybrid applications. Worklight also provides a secure foundation for native applications, and can be easily incorporated to any existing (or new) native app.

In this post, I’ve put together a video series to take a look at just how easy it is to setup Worklight in an existing iOS native application to provide remote log collection, application management, and more. Read on for complete detail, or check out the complete multi-video playlist here.

The existing app that I’ll be integrating is based on an open source Hacker News client, which I downloaded from GitHub. Check out the video below for a quick introduction to what we’ll be building.

If you want, you can leverage the Worklight IDE – a set of developer tools built on top of the Eclipse development environment. If you don’t want to use Eclipse, that’s OK too – Worklight can be installed and configured using the Worklight command line interface (CLI) and you can leverage any developer tools that you’d like to build your applications. Want to tie into Xcode ? No problem. I’ll be using the Worklight CLI to setup the development environment in this series.

Setting up the Worklight Server

The Worklight server is the backbone for providing Worklight features. App managment, remote logging, operational & network analtics, and all of the Worklight features require the server, so the first thing that you need to do is setup the server for our environment. Check out the next video, which will guide you through setting up a Worklight server/project using the CLI.

First things first, you have to start the Worklight server. If you haven’t already configured a Worklight server, run the create-server command to perform the initial setup – this only has to be run once ever.

wl create-server

Now that the server is setup, we need to create a Worklight project. For this walkthrough, I’ll just call it “MyWorklightServer”:

wl create MyWorklightServer

Next, go into the newly created project directory and go ahead and start it.

cd MyWorklightServer
wl start

Once the server is started, add the iOS platform:

wl add api

You will be prompted for an API name. This can be anything, but you should probably give it a meaningful name that identifies what the API will be used for. In this walkthrough I specify the name “MyiOSNativeAPI”.

01-Worklight-CLI

Next you will be prompted to select a platform, select “iOS”
Next, build the project, and then deploy it to the server:

wl build
wl deploy

Next, launch the Worklight console to view that the project has been deployed and the native API has been created. The console will launch in the system web browser.

wl console
02-Worklight-Console
Worklight Console

 

Be sure to check out the Worklight CLI documentation for complete detail on the CLI commands.

Xcode Integration

Next we need to setup the Xcode project to connect to the newly created Worklight server. If you’re adding Worklight to a new Xcode project, or an existing Xcode project, the preparation steps are the same:

  1. Add Worklight files to your Xcode project
  2. Add framework dependencies
  3. Add the -ObjC linker flag

This next video walks through configuration of your Xcode project and connecting to the Worklight server (which we will cover next):

In the Xcode project navigator, create a folder/group for the Worklight files, then right click or CTRL-click and select “Add Files to {your project}”…

03-add-files

Next, navigate to the newly created MyiOSNativeAPI folder and select the worklight.plist file and WorklightAPI folder, and click the “Add” button.

04-add-files-2

Once we’ve added the files to our Xcode project, we need to link the required framework/library dependencies:

  • CoreData.framework
  • CoreLocation.framework
  • MobileCoreServices.framework
  • Security.framework
  • SystemConfiguration.framework
  • libstdc++.6.dylib
  • libz.dylib

Next, In the Xcode project’s Build Settings search for “Other Linker Flags” and add the following linker flag: “-ObjC”.

05-linker-flag

If you’d like additional detail, don’t miss this tutorial/starter app by Carlos Santanahttps://github.com/csantanapr/wl-starter-ios-app

 Connecting to the Worklight server

Connecting to the Worklight server is just a few simple lines of code. You only have to implement the WLDelegate protocol, and call wlConnectWithDelegate, and the Worklight API handles the rest of the connection process. Check out the video below to walk through this process:

Implement the WLDelegate protocol:

//in the header implement the WLDelegate protocol
@interface MAMAppDelegate : UIResponder <UIApplicationDelegate,
   WLDelegate> {

//in the implementation, add the protocol methods
-(void)onSuccess:(WLResponse *)response {
}
-(void)onFailure:(WLFailResponse *)response {
}

Connect to the Worklight Server:

[[WLClient sharedInstance] wlConnectWithDelegate: self];

Next, go ahead and launch the app in the iOS Simulator.

You’re now connected to the Worklight server! At this point, you could leverage app management and analytics through the Worklight Console, or start introducing the OCLogger class to capture client side logging on the server.

App Administration via Worklight Console
App Administration via Worklight Console

 

Worklight Analytics Dashboard
Worklight Analytics Dashboard

 

Remote Collection of Client Logs

Once you’re connected to Worklight, you can start taking advantage of any features of the client or server side APIs. In this next video, we’ll walk through the process of adding remote collection of client app logs, which could be used for app instrumentation, or for debugging issues on remote devices.

On the server, you’ll need to add log profiles to enable the capture of information from the client machines.

Adding Log Profiles
Adding Log Profiles

On the client-side, we just need to use the OCLogger class to make logging statements. These statements will be output in the Xcode console for local debugging purposes. If a log profile has been configured on the server, these statements will also be sent to the Worklight server.

OCLogger *logger = [OCLogger getInstanceWithPackage:@"MyAppPackageName"];
[OCLogger setCapture:YES];
[OCLogger setAutoSendLogs:YES];

//now log something
[logger log:@"worklight connection success"];
[logger error:@"worklight connection failed %@", response.description];

For complete reference on client side logging, be sure to review the Client-side log capture API documentation.

App Management & Administration

Out of the box, Worklight also provides for hassle-free (and code-free) app management. This enables you to set notifications for Worklight client apps and disable apps (cutting off access to services and providing update URLs, etc..). This next video walks you through the basics of app management.

Be sure to check out the complete documentation for app management for complete details.

All done, right?

At this point, we’ve now successfully implemented Worklight server integration into a native iOS app. We have remote collection of client-side logs, we can leverage app management, and we can collect operational analytics (including platforms, active devices, and much more).

If you don’t want to leverage any more Worklight features, then by all means, ship it! However, Worklight still has a LOT more to offer.

Exposing Data Through Adapters

Worklight also has the ability to create adapters to expose your data to mobile clients. Adapters are written in JavaScript and run on the server. They help you speed up development, enhance security, transform data serialization formats, and more.

In the next two videos we will walk through the process of collecting information inside the native iOS application and pushing that into a Cloudant NoSQL data base (host via IBM Bluemix services).

Cloudant databases have a REST API of their own, so why use a Worklight Adapter? For starters, Worklight becomes your mobile gateway.  By funneling requests through Worklight, you are able to capture analytic data for every server invocation, and Worklight gives us the ability to control access to the enterprise.  Worklight gives you the capability to cut off mobile access to the backend at any time, just by changing the API status.

Now let’s take a look at the process for exposing the Cloudant database through a Worklight Adapter:

Once the data adapter has been configured, it is simple to invoke the adapter procedures to get data into or out of the your applications.

This next video covers the process of pushing data into the Cloudant database adapter from the native mobile client application:

Once again, you will have to implement the WLDelegate protocol to handle success/error conditions, and the procedure invocation is implemented using the WLClient invokeProcedure method:

NSMutableDictionary *userProfile = [[NSMutableDictionary alloc] init];
[userProfile setValue:self.email.text forKey:@"email"];
[userProfile setValue:self.firstName.text forKey:@"firstName"];
[userProfile setValue:self.lastName.text forKey:@"lastName"];    

WLProcedureInvocationData * invocationData = [[WLProcedureInvocationData alloc] initWithAdapterName:@"CloudantAdapter" procedureName:@"putData"];
invocationData.parameters = @[userProfile];

[[OCLogger getInstanceWithPackage:@"UserProfile"] log:@"sending data to server"];
[[WLClient sharedInstance] invokeProcedure:invocationData withDelegate:self];

It is as simple as that.

IBM MobileFirst Foundation (aka Worklight) is for more than just hybrid app development. It is a secure platform to streamline your enterprise application development processes, including everything from encryption, security and authentication, to operational analytics and logging, to push notifications, and much more, regardless of whether you’re targeting hybrid app development paradigms, or native iOS, native Android, or native Windows Phone projects.