All Products
Search
Document Center

Mobile Platform as a Service:Create a service

Last Updated:May 12, 2022

In the process of developing an application based on mPaaS iOS framework, you can set the general functions without UI as a service (e.g. login) which can be easily obtained by other micro applications or services through the whole App running period. To add a service, you must add service template codes, and register a service.

Procedure

  1. Add service template codes.

    1. Define the service’s protocol and expose the external interface method.image

    2. Define the class to implement the service interface method.image

  2. Register a service.

    Similar to the micro application, the newly created services can be managed in a unified way via the framework only when they are registered in MobileRuntime.plist.service

    Field

    Description

    Name

    The unique identifier of a service.

    Class

    The implementation class of service. When creating a service, the framework utilizes a run-time reflection mechanism to create the instances of the service implementation class.

    lazyLoading

    Whether to delay loading. If Yes, the service will not be instantiated when the framework starts. Only when being used can the service be instantiated and launched. If No, the service will be instantiated and launched when the framework starts. It defaults to No.