What is Data Source?
- DataSource, as the name suggests - acts as a bridge between your Mobile App and the source of the data to be displayed on the screen.
- In most general cases, DataSource would contain the API source through which you can either submit or fetch the data. You can either connect APIs developed with Configure.IT straight away or you can use some other third party source available for integration with Configure.IT within AppConsole.
- Any API would have Input and Output parameters. Using Datasource configuration window, you can define the value for Input parameters and also how output parameters would be used on the current screen or to be used later in the project.
- Once you are in Configuration panel, First option on right side menu is DataSource. Click on
List Data Source
- Clicking on Datasource will slide down the screen of data source which will list down the already configured Datasources.
- Datasource Actions: On Datasource panel there are some actions available to manage your Data sources, such as -
- Edit Datasource - Select the datasource from list of Datasources that you want to edit. Tapping on this button will let you edit the datasource.
- Add Events - Once the datasource is added, you can configure some events to be executed. Below mentioned are the events available for datasource -
- Datasource Loaded - Once API is executed, this event will be fired. So if you want to perform some action after API result is successful or failure then you can set those conditions in this Event and set proper actions.
- Alert Button Click - On Datasource loaded event, if you have configured, “Show Alert View” action then whenever alert view action button is tapped, this event will be fired.
- Delete - Tap on the Delete button, if you wish to delete any Datasource.
- Clone Datasource - Tap on Clone datasource button , if you want to clone the entire data source including its configuration.
- Select Screen: You need to select the screen where the original datasource is used.
- Select Datasource: Once screen is selected, it will list all the data sources used in that screen as shown on above image. You need to select the data source to be cloned. Click on CLONE button to start cloning process. It may take few seconds.
- To Configure the Datasource, you need to fetch data using API and to configure API, To add a Datasource, you need to configure Input Parameters and Output Parameters.
- While Configuring Input Parameters, you can select either internal/custom API - made by you in the same app or Third Party API such as Facebook, Twitter etc.
- Select the main API which you want to process in current datasource. Based on Datasource selection (Third Party Yes/No), it will display the list of available APIs in your project.
- If it is third party Datasource, then it will display list of Third Party APIs and if it is custom Datasource, then list of configured APIs will be displayed.
- Select Third Party On / Off. Default value is OFF i.e.Configure.IT/Internal API.
- Choose API or Select Third Party List:
- Configure.IT / Internal API: It lists all the available APIs configured for this project from Backend configuration interface.
- Third Party API: It lists all Third Party APIs provided by Configure.IT. To know how to configure Third Party API, Please click on “Third Party API”
- Select Silent Datasource On / Off - When turned On, the app will process the API request / response without showing the "busy" indicator. This will prevent users from seeing the loading spinner, and allow them to continue browse the app, while the API process is being executed in background (while the app is still in active mode)
- Give Data Source Name: Give a name to this Data Source. If you're using multiple Data Source in a screen, make sure this name is unique.
- If it's custom API then you would be able to add Input & Output Parameters immediately in the same screen.
- If it is Third Party API then you can save the new datasource and then go to the list, click on Edit to add Input & Output Parameters.
Depending on the API selected, the input parameters will require you to mention the values / source of values for each input parameter.
- List Input Parameters
- This will list all the input parameters of the selected APIs with the source, value and validation put on them.
- Refresh Parameters: Clicking on this will refresh the list of parameters. This is needed when any changes are done and you want to see the updated list.
- Add new Input Parameter: New parameter can be added anytime using this icon.
- Move Up / Move Down: Parameter positions can be changed using these Up and Down buttons.
- Delete : Erase any Input parameter with this button.
- It will also show you Test API and Map Output Parameter which can be used to fetch sample data and check the performance using Execute button
- Execute - During the configuration, we need to fetch output parameters so that it can be further configured, to do so, you have to click this button once during the process, so that the output parameters of the API can be fetched for further configuration. You need to enter sample values for all input parameters and it will execute API and fetch the output parameters list.
- Add Input Parameters
- Input Param Name - The name of the Input parameter for which you want to enter the input data. It should match with actual API Input parameters.
- Param Source - This is used to define the source from where the parameter value will be read dynamically. Below mentioned are the available options, for the same
- Static - You can enter any string value or integer value depending on your requirement.
- Previous Page - Provide the key of API that is loaded in the previous screen (loaded before this screen). For Example - There are two screens in the app, FirstScreen and SecondScreen. In FirstScreen, you have loaded an API, named as “CountryList” having keys with name “ID” and “Name”. Now, you want to pass API data to the next screen. At this point, you can use previous page API key as input for the SecondScreen API. The input to the API will be either “ID” or “Name”, as per your requirement.
- Session - Session is very important thing to understand as generally mobile application does not have concept of Session. It is similar concept as Web development.
You can save data temporarily or permanently in the app. Temporary data will be deleted after app gets closed and Permanent data will remain saved even after app is closed, until the app is deleted from the device. Choosing session will open up the list of options where you have saved the data or to read the default data.
Below mentioned is the list of the default data available in the
- current_location_latitude :- To get latitude of current location.
- current_location_longitude :- To get longitude of current location.
- current_location_postal_code :- To get current location postal code.
- current_location_country :- To get current location‘s country.
- current_location_address :- To get current location address.
- current_location_state :- To get current location state
- Device_UUID :- To get unique ID of device.
- Device_Token :- To get device token.
- temp_audio_path :- To get audio path of the recorded audio.
- temp_video_path :- To get video path of the recorded video.
- temp_image_path :- To get image path of the captured image.
- APP_LANGUAGE :- To get the current used language in the device.
- Form Object (Screen Control) - To read value of any control placed on the screen, you need to use this option. It will show list of controls available on the screen. Selecting an object from Object Tree of controls list will read value of that field automatically at the time of execution of the API.
For example, you can use this option to read values from Username and password text field, respectively and pass to the
- Response - Response is the result of any API call and can be used here to refer to any parameter / key of API response. Set the key of an API output parameter that has already been executed on the current screen. It will read its output value directly at the time of current API execution.
- Device Info - If you want to pass any data related to the device as input to the API, you can do so via Device Info.
The options available for the device info are as :-
- Device_UUID :- To get unique device ID.
- Device Name :- To get device name that is kept by the device owner.
- Device Model :- To get names of the device models that user will be using.
- Device Battery State :- To obtain the current status of the battery of device.
- Device Type :- To obtain the device type whether it's iphone or ipad.
- Device_Token :- To get device token.
- Device Language :- To get device’s language.
- Device TimeZone :- To get device’s current time zone.
- Device country Code :- To get device’s current country code.
- Device Current Year :- To get current year from the device.
- Device Current DateTime :- To get current date and time of the device.
- Device IP Address :- To get IP address of the device.
- Device Mac Address :- To get Mac address of the device.
- Device Total Memory :- To get total memory of the device.
- Device Free Memory :- To get free memory of the device.
- Device Total Usage :- To get total usage of the device.
- Device Total User Usage :- To get total user usage of the device.
- Device Total System Usage :- To get total system usage of the device.
- Device CPU Idle:- To get idle time of the device.
- Value - Based on Param source, this field is used. If Param source is static then it will be used to enter the static value, whereas if param source is of any other type then it will give you a popup to select object (control) from screen.
- Validation - If you want to execute any validation before passing value to API Input parameter, then you can set this value here. Configure.IT
supports different validations.
- Email - It is used to verify whether the entered value is in proper Email format.
- Required - If any parameter is compulsory then you can set it as Required.
- Min Length - For the minimum characters to be entered for the input.
- Max Length - For the maximum characters to be entered for the input. (For example, you provide value 10, as per that if the user tries to enter more than 10 characters as input for the key then the alert message will be displayed that you have set in this window.
- Is Equal - For the equality of the input with the static value with which you want to compare.
- URL - It is used to verify whether the entered value is in proper URL format.
- Phone Number - It is used to verify whether the entered value is in proper Phone number format.
- Number Only - It is used to validate that only numeric values are accepted.
- Regex - If you want to validate the input value with any specific pattern then provide Regex format on Validation message popup window.
- This can be used to match email address, floating points, valid dates, verifying credit card numbers etc.
- For example <([a-z][a-z0-9]*)\b[^>]*>(.*?) checks if the string has valid html / xml tags.
- Min Value - If you want to restrict entry with not less than a particular number, then this validation is useful.
- Max Value - If you want to restrict entry with not greater than a particular number, then this validation is useful.
- Name - Any name generally does not include Number or special character. To implement the same, this validation is used.
- Alpha Numeric - If input value must contain characters or numbers or both then this validation type is used.
- Alpha Numeric Inclusive - If input value must contain characters and numbers both then this validation type is used.
For each validation type, you can define validation message that will be displayed if the condition is not satisfied. From validation message popup panel, each validation message can be set.
Output Parameters -
Each API returns some values in form of Output parameters. You can directly use those values for further configuration of your project. Those values can be used to set value for any control or save its value in session.For each Output parameter, you need to set some properties.
- Output Param Name - Name of output parameter which will be used for further reference. It is actual name of output parameter which is set for API.
- Output Type - This field is used to define as to how you want to utilize the parameter value. There are 2 options for the same, as under -
- Form Object - If you want to display parameter value directly on any of Form Object then you can set this value. It will show list of controls available on current screen in Object Tree.
- Session - If you want to set parameter value as Session, then this option is used. While saving value in session, it will ask to enter Session Key name. This session value / Key name can be used anywhere on the app till you remove the session.
How to create Third party Datasource of any Social Media login?
- In Mobile App configuration panel, Open "DATA SOURCES" tab from right side panel and click on “Add Datasource”
- Turn On the button of Third Party API.
- Select Third Party List. It will show Readymade third party APIs which are directly integrated into mobile app with Native SDKs. For example, Facebook SDK, or Twitter SDK.
- For example, select "User Details" under "Facebook".
- Enter a name for your API in "Choose API" text box.
- Now click on "OUTPUT PARAMS" tab. You will get to see the output parameters for the API call action for this "Facebook" API.
- Save the configuration. And like any other API use "API call" action for this API.
Which Third Party APIs are available?
- Following is the list of third party APIs that are available.
- Friend List
- User Details
- HashTag List
- Follower List
- Following List
- User Details
- Get Tweets
- Google +
- Get User Details
- Get Friends
- Get Moments
- Sign Out
- Logged In User Details
- Details of User connection
- Get Friends List
- Get Company Info
- Get jobs posted by company
- Network updates of Logged User
- Search Companies
- Get Account Details
- PayPal Payment
- Get Contacts
- In App Purchase
- In App Purchase
- In App Restore
- Google Analytics
- Add Event
- Get User Profile Details
- Add Event
- Get GCM Registration Id
- Google Places
- Get Google Places
How to Configure Paypal - Online Payment System?
To Configure Paypal - Third Party API, Please follow below steps:
- Open Third Party tab and enable PAYPAL by clicking checkbox to the right and click SAVE button. Fields given in Third Party -> PAYPAL section will work only while viewing your app in PreviewIT application. (You need to create your own PayPal client Id for production and sandbox mode after downloading your application. Please follow this link to create your own credentials after you download your app https://developer.paypal.com/docs/integration/admin/manage-apps
- After activating PayPal in your app, you need to add PayPal Payment third party API to a screen, in which you want to use PayPal payment. Open that particular screen and then click on Data sources tab, click +Add Datasource button to add new API.
- Now ADD DATA SOURCE dialog opens up. Enable Third Party switch and the select PayPal Payment from Select Third Party List dropdown.
- Configure source values for given parameters list (amount, currency_code, description,.. etc) as you do for other APIs. And then click SAVE button.
- You can now see new API and it will be added to your APIs list in Data sources tab. You can call this newly added API using Trigger Data Source (API Call) action as in case of any other API.
- How to Configure Third Party API of Social Sharing: https://www.youtube.com/watch?v=sn2YgdQ0ofA
- How to configure Third party Data source: https://www.youtube.com/watch?v=sANRCz_P7mc
- How to Integrate Payment Gateway: https://www.youtube.com/watch?v=yDUo5IbESaA