Configuration

App methods are the basic methods of FrameworkJS that must be configured. In this section will be created a general configuration of the application. So we will explain in detail.

app.name

The name corresponds to CloadIO account name. After creating the account, the account name must be set in app.name to establish communication between CloadIO and FrameworkJS.

  • Type: String

  • Example
    Performing an app name inside the app.js configuration:
    //------------------ config ------------------------------
    app.name = 'myApp';
    //------------------ end of config -----------------------

app.http

Domain and ssl configurations to access files through the http protocol.

  • Type: Object

  • Detail

    The domain is the url of domain and it is set in app.http.domain. The secure sockets layer is protocol for web browsers and servers that allows for the authentication, encryption and decryption of data sent over the internet. It can be true or false in app.http.ssl.

  • Example
    Performing a http configuration inside the app.js:
    //------------------ config ------------------------------
    // domain and ssl configurations to access files through the http protocol
    app.http = {
        domain: 'myApp.cloadio.com',
        ssl: false
    };
    //------------------ end of config -----------------------

app.cloadio

It can be enable or disable all related functions to CloadIO. z

  • Type: Object

  • Detail

    The first property is related to back-end codes. If you don't need the back-end, set the app.cloadio.enable value to false.

    The secure part is using a TLS connection. If you need to keep a secure connection, you can set app.cloadio.secure true.

    You can execute code on all devices remotely through CloadIO functions. To aim this purpose you must set true for app.cloadio.allowRemoteExecution property. If you don't need to have an "allowRemoteExecution", you can set it to false.

    The last one is puip, the path of saving users'data in CloadIO. By default it is set to '/clients'. Therefore according to project needs, app.cloadio.puip can be changed.

  • Example
    Performing a CloadIO configuration inside the app.js:
    //------------------ config ------------------------------
    app.cloadio = {
        // you can enable or disable all functions related to cloadio.
        // if you don't need back end disable it.
        enable: true,
    
        // use tls connection
        secure: false,
        
        // you can execute code on all devices remotely.
        allowRemoteExecution: true,
    
        // public users info path
        puip: '/clients'
    };
    //------------------ end of config -----------------------

app.install

This is about getting user's information.

  • Type: Object

  • Detail

    When user installs the application first, if you set app.install.enable value to true, user's information such as device token, time zone, etc. is stored with an unique ID. You can set it false if you don't need to this section.

    The app.install.path is the path of saving users' information. This is set to '/installs' by default.

  • Example
    Performing a install configuration inside the app.js:
    //------------------ config ------------------------------
    app.install = {
        // track app installs
        enable: true,
    
        // install details path
        path: '/installs'
    };
    //------------------ end of config -----------------------

app.version

In FrameworkJS, there are two kinds of app versions for configurations. The min version is set on CloadIO based path and a current version that you can change. If the min version is greater than the current version, an update page will be run.

Notice

For using the app version property, your app must have update page(html, css and js).

  • Type: Object

  • Detail

    If you want to active the min version in the project, you must set true the app.version.control value.

    You can change the current version value at app.version.current property. The current version value is consists of numbers and it has a simple syntax. It includes year, month, day, hour, and minutes. These digits should be 12 characters.

    Notice

    Note that if you don't want the update page to be displayed, the current version must be greater than the min version.

    The app.version.mvp is the path of saving min version in CloadIO, it is set to '/update/minVersion' by default. Therefore, it can be changed according to project's needs.

  • Example
    Performing a version controlling configuration inside the app.js:
    //------------------ config ------------------------------
    app.version = {
        // control min version
        // if minimum version be greater than the current version update page will be shown
        // so app must have update page
        control: false,
    
        // current version
        current: 202104031943,
    
        // min version path
        mvp: '/update/minVersion',
    };
    //------------------ end of config -----------------------

app.update

This section is about using auto-update on CloadIO.

  • Type: Object

  • Detail

    If you want to use update, you can set app.update.autoUpdate to true othewise you can set it false.

    The app.update.auup is the url of uploaded source of project for auto-update in CloadIO. It is set to '/update/url' by default. It means the project's file should be uploaded in this path.

  • Example
    Performing an auto update configuration inside the app.js:
    //------------------ config ------------------------------
    app.update = {
        // auto update
        autoUpdate: true,
    
        // auto update url path
        auup: '/update/url'
    };
    //------------------ end of config -----------------------

app.localization

To determine the calendar, language, and time zone in FrameworkJS.

  • Type: Object

  • Detail

    If used language in the application is left to right, the app.localization.language.direction should set to ltr, like the English language, otherwise it should be set to rtl, like the Arabic language. Every language has an abbreviation word, So the value of the app.localization.language.code property should be the abbreviation word of the used language.

    The app.localization.calendar property is for the calendar type. It is set on "gregorian" by default. It is clear that you can change it according to project used language.

    The last section determines the local time. In app.localization.timeZone, you should write the time difference between the application and Greenwich time.

  • Example
    Performing a localization configure inside the app.js:
    //------------------ config ------------------------------
    app.localization = {
        language: {
            direction: 'ltr',
            code: 'trTr'
        },
        calendar: 'gregorian',
        timeZone: '02:00'
    };
    //------------------ end of config -----------------------

app.auth.fpn

When a user is not authenticated, you define a page name in the app.auth.fpn to direct user to that page. For instance, you can define a login page when users have not authenticated so that to get the required information.

  • Type: String

  • Example
    Performing a first page shown before user authentication configuration inside the app.js:
    //------------------ config ------------------------------
    app.auth.fpn = 'login';
    //------------------ end of config -----------------------

app.notification

In FrameworkJS, You can configuration the notification service.

  • Type: Object

  • Detail

    For using notification service, should set the app.notification.enable property to true.

  • Example
    Performing a notification configuration inside the app.js:
    //------------------ config ------------------------------
    app.notification = {
        enable: true
    };
    //------------------ end of config -----------------------

app.appearence

Here is to change the background and text color of the status bar in android and iOS devices.

  • Type: Object

  • Detail

    For the background color, you should use a HEX code, to change the background of status app.appearance.backgroundColor should have a suitable value.

    For setting the status bar text color you can set app.appearance.statusBar value in light or dark attribute.

  • Example
    Performing an appearance configuration inside the app.js:
    //------------------ config ------------------------------
    app.appearance = {
        statusBar: 'light',
        backgroundColor: '#000000'
    };
    //------------------ end of config -----------------------

app.statistic

The FrameworkJS uses this feature to increase product quality and performance.

  • Type: Object

  • Detail

    If you set the app.statistic.enable true it will send statistic data to FrameworkJS lab otherwise not sent.

  • Example
    Performing a statistic data configuration inside the app.js:
    //------------------ config ------------------------------
    app.statistic = {
        // send statistic data to framework lab.
        enable: true
    };
    //------------------ end of config -----------------------