WaveMaker Docs

WaveMaker Docs

  • Get started
  • Widgets
  • How-to
  • Releases
  • Login
  • Start free trial

›Mobile Integrations

Getting started

  • Introduction
  • Walkthrough

App design

  • UI Overview
  • Create Pages
  • Designing Pages
  • Widgets Composition
  • Page Configure

    • Page Layout
    • Page Artefacts
    • Partial Page
    • Page Parameters
    • Navigation
    • Events
    • Examples

    Apply Styles

    • Themes
    • Templates

Backend

  • Backend Services
  • Introduction to API Designer

- Data services

  • Database Services Overview
  • Database Tools
  • Database Designing

    • Working with Databases
    • Data Modelling
    • DataBase Schema Modes
    • Working with DB Schema
    • Database Views
    • Temporal Support

    Accessing Database

    • Accessing Database
    • ORM Artifacts

    Queries and Procedures

    • Working with Queries
    • Working with Stored Procedures
    • Version Queries & Procedures
    • Blob Queries and Procedures
    • Queries & Procedures - Java Services

    Database Variables & API

    • Database CRUD
    • Database APIs
    • Database Service APIs

- Web services

  • Web Services Overview
  • Services

    • REST Services
    • Secure Server-side Properties
    • REST Services using OAuth 2.0
    • Working with SOAP Services
    • Working with WebSockets

    Web Service Variables & API

    • Web Services Variable
    • Web Service APIs

- Java services

  • Java Service
  • Java Services

    • Java Integration Services
    • Variables for Invocation
    • Generated REST APIs (API Designer)

    Java Services Variables & API

    • Variable for Java Service
    • Java Service APIs

    Manifest files

    • 3rd Party Libraries
    • Using 3rd party JavaScript files
    • Using 3rd party jar files

- Security services

    App Security

    • Overview
    • Authentication
    • Authorization
    • Access Levels & Permissions
    • Login Configuration
    • SSL Encryption
    • XSS antisamy policy configuration
    • OWASP
    • Central Authentication System
    • Token Based Authentication
    • SAML Integration

    Security Variable and API

    • Security Variables
    • Remember Me
    • Variable for Security Service
    • Security Service APIs

Integration

  • Service Integration
  • Variables

    • Variables Overview
    • Model Variable
    • Device Variables
    • Variable Binding

    Actions

    • Actions
    • Navigation Action
    • Login Action
    • Logout Action
    • Timer Action
    • Notification Action

    Events

    • Events
    • JavaScript Access

Developer options

  • Test and Run (Preview) Apps
  • Import, Export & Update Apps
  • Project Shells
  • Localization
  • Developer Integration

    • Project User Management
    • Developer Collaboration
    • Debugging
    • Extending the Application using IDEs

    Deployment

    • Release Management
    • Configuration Profiles
    • Build Options for App Deployment
    • One-Click Deployment
    • Manage Deployed Apps

    Configuring Web Server

    • Deploy to Web Server Overview
    • Building a War from a WaveMaker Project
    • AWS
    • Azure
    • Google Cloud
    • Deploy to Tomcat
    • WebSphere
    • JBoss - WildFly
    • WebLogic Server

Develop extensions

  • Create Prefab
  • Use Cases - Prefabs
  • Create Themes
  • Create Template
  • Artifacts Repository

Mobile app

  • Building Hybrid Mobile Apps
  • Native Device Support
  • First Mobile App
  • Mobile Design

    • Mobile Page Design
    • Gesture Support
    • Mobile Tabbar
    • Mobile Navbar

    Mobile Installer

    • Test Run (Preview)
    • Debugging Mobile Apps
    • Testing Hybrid Mobile Apps using WaveLens
    • Mobile Build - Android
    • Mobile Build - Phonegap
    • Mobile Build - Manual

    Mobile Integrations

    • Mobile Integrations - Amazon Mobile Analytics
    • Mobile Integrations - Amazon SNS
    • Using Push Notifications in Mobile Device
    • Invoking Web App APIs in Mobile Apps

    Offline Features

    • Offline Data Support
    • Implementation
    • Switching between Offline and Online Mode

Enterprise

  • Setup Guide
  • Launching Instances
  • DEB Installer - Private AMI
  • Add external VCS Configuration
  • Custom Apps Capacity
  • Setting up WME
  • Configuration
  • Adding Capacity
  • Maintenance
  • Upgrading
Edit

Invoking Web App APIs in Mobile Apps


To access the APIs of WaveMaker Web App (say Project1) into Hybrid Mobile App (say, Project2), you will need to import the services in the form of REST services.

The API’s in Project1 can be of two types:

  • Authenticated: In this case, you will need to either use HTTP Authentication while importing the service or you could use the authorization token as the Header.
  • No authentication: In this case, you can directly import the web API into the project2 as a REST API.

Accessing unAuthenticated Services

  1. In the web app Project1: (As an example, we will look at accessing the sample database services i.e hrdb’s services)

    • From the API Designer navigate to the Database Service to access the API's and from the Test tab copy the Request URL
  2. Open the mobile app, Project2:

    • Using Web Service Integration, import Rest service
    • Provide the above URL as Service URL.
    • Click on Test and Import the web service.

    Note: You will need to deploy your application(Project1) to access its services in Project2.

Accessing Authenticated Services

In the case of Authenticated Web App, you will need to use either HTTP Authentication while importing the service or pass the Authorization token in the Header.

We recommend you generate an authorization token at the initial load of the application (for instance, from the onPageReady event of the landing page of the application or from the onSuccess event of the loginAction, in the case security is enabled for Project2). You can then use the authorization token to access the other authenticated services of Project1.

To import the Web API’s in Project2, you will need to use the Request URL for the API’s calls of Project1. You will be able to access the API's for the services in the Project1 through the API Designer.

You will need to use HTTP Authentication initially while importing the token API to generate the access token. This access token will then be used to access the remaining authenticated services.

Step 1: Obtain the Auth Token

  1. In the Web App, Project1:
    • From the API Designer, navigate to the Security Service to access the authenticated API's
    • Locate the Get Token API, and copy the Description Request URL from the Test tab of the API.
  2. Open Mobile App, Project2:
    • Using Web Service Integration, import REST Service
    • Provide the above URL as Service URL.
    • Set HTTP Authentication to Basic and provide the test User Name and Password.
    • Test the connection.
    • From the Response tab, locate and make a note of the wm_auth_token.
    • Import the service.
  3. Variable for Auth Token
    • Access variable dialog and click the New Variable button to create a Model Variable
    • Enter wm_auth_token from the previous step as the dataValue
  4. After the token is generated and stored, you can access the services of Project1 using that token.

Step 2: Accessing Authenticated Services

  1. In the Project1: (As an example, we will look at accessing the sample database services i.e HRDB’s services.)
    • From API Designer navigate to the Database Service to access the authenticated API's
    • from the Test tab copy the Request URL
  2. Open Mobile app, Project2:
    • Import REST Service
    • Provide the above URL
    • In the HEADERS tab provide the Name as "wm_auth_token" and Test Value as the token generated above.
    • Click on Test and Import the web service.

Note: You will need to deploy your application(Project1) to access its services in Project2.

B.4 Mobile Integrations

  • 4.1 Amazon Cognito
  • 4.2 Amazon SNS
  • 4.3 Amazon Mobile Analytics
  • 4.4 Push Notifications
  • 4.5 Invoking Web App APIs in Mobile Apps
Last updated on 11/12/2019 by Swetha Kundaram
← Using Push Notifications in Mobile DeviceOffline Data Support →
  • Accessing unAuthenticated Services
  • Accessing Authenticated Services
    • Step 1: Obtain the Auth Token
    • Step 2: Accessing Authenticated Services
WaveMaker
  • PRICING
  • PARTNERS
  • CUSTOMERS
  • ABOUT US
  • CONTACT US
Terms of Use | Copyright © 2013-2019 WaveMaker, Inc. All rights reserved.