Welcome to CA Mobile App Services (MAS) blogs. MAS aims at saving your development time by providing complex mobile features wrapped in simple to use methods. Sounds interesting! So, stay with us for the exciting journey of using our MAS services for your Cordova-based apps. This blog post will walk you through the cool features of MAS, and will guide you to create a basic beginner app.
Let’s consider a coffee house as analogy to explain MAS. To enter the coffee house, you need proper credentials to get in and access the services. Once you are in the coffee house, you see a bustling place with people occupying tables. Consider the tables as groups and the people as the users.
The group administrator directs you to a table. You can create your own groups (if you’re that lonely). The server can let you access or deny access to certain services depending on your credentials. You can send messages to individuals or groups. You can also store your coffee, and retrieve it later. In the context of MAS, this situation represents the following four major components of MAS:
Authenticates users, manages users, apps, and device registration. Sounds difficult? Trust us, it is quite simple with our MAS Foundation module.
Manages identity of the users, creates and manages ad-hoc groups. Implements SCIM 2.0 standards to simplify user management.
Secures communication among groups is achieved by our robust MAS Connecta APIs.
Provides local and cloud storage facility with enterprise-grade encryption.
Now that you know the benefits of our wares, let us start building a basic Cordova app using the MAS Foundation to login and access a protected API.
What do you need to start?
- A PC or MAC
- Mobile device or a simulator
- Xcode or Android Studio or a terminal
- Mobile API Gateway (MAG)
MAG shares the msso_config.json file that provides the address of the MAG server to the Cordova app.
Follow the instructions to create a basic Cordova app to start a project:
1. Run the following command in the terminal:
ionic start masFoundation
You just created a folder named masFoundation, where you have an app with a default template ready for you.
2. Add iOS or Android mobile platform as follows:
Ensure that you have the Android Studio or an iOS xcodeproj ready in the platform folder.
ionic platform add android
3. Now, add our esteemed plugin to the mix. Download or clone the MAS Foundation from GitHub repository.
4. To add the plugin to your cordova project, run the following command:
ionic plugin add PATH_TO_PLUGIN
where “PATH_TO_PLUGIN” is the location of the plugin on your machine.
Now let us dive down to the platform specific setup. Let us view the iOS setup first. The Android setup section will be below.
1. Download the SDK libraries from the CAAPIM Releases repository.
2. Navigate to the “MAS-*latestVersion*-CR1/iOS” folder, and download the iOS-MobileSDK-<version>.zip file.
3. Open the Cordova iOS project in Xcode, and add the MASFoundation.framework, MASUI.framework, and MASUIResources.bundle files.
4. Configure the following property in the “.plist” file located in the Resources folder of the project:
<key>NSLocationWhenInUseUsageDescription</key> <string>The application needs a location to use the MAS backend services</string>
A screenshot for your reference: