Create a service
In the mPaaS iOS framework, implement UI-less common features as services (such as logon) so other micro-apps or services can access them at runtime. To add a service, add the template code and register it.
Code sample
Download and view the iOS framework demo in Get code sample.
Procedure
-
Add the service template code.
-
Define the service protocol and expose the public interface methods.

-
Define the class that implements the service interface methods.

-
-
Register the service.
Like micro-apps, register the service in
MobileRuntime.plistfor the framework to manage it.
Field
Description
name
The unique identifier for the service.
class
The service implementation class. The framework instantiates this class through runtime reflection.
lazyLoading
Whether to lazy-load the service. If enabled, the service starts only on first use instead of at framework startup. Default:
NO.