SIKIServiceEvents Protocol Reference

Conforms to NSObject
Declared in SIKIServiceEvents.h

Overview

It exposes APIs to handle service events

– onStart required method

This is the first method to be called when a service is created.

- (void)onStart

Discussion

This is the first method to be called when a service is created.

OnStart is always overridden to perform any startup initializations that may be required by a Service such as:

  • Initializing variables
  • Binding static data to service
  • Binding related screen to service

    Once OnStart has finished, Connect will call OnServiceQueue if Service is in ASYNC mode else OnServiceApiInvoke. *

  • Declared In

    SIKIServiceEvents.h

    – onQueue required method

    This method is called when the service is put in the queue for the execution.

    - (void)onQueue

    Discussion

    This method is called when the service is put in the queue for the execution.

    Declared In

    SIKIServiceEvents.h

    – onPause required method

    This method is called when there is no network. Services should override this method if they need to:

    - (void)onPause

    Discussion

    This method is called when there is no network. Services should override this method if they need to:

  • Commit unsaved changes to persistent data
  • Destroy or clean up other objects consuming resources
  • Display any relevant alerts or dialogs *

  • Declared In

    SIKIServiceEvents.h

    – onResume required method

    The Connect calls this method when the Service is ready to start executing.

    Services should override this method to perform tasks such as:

    - (void)onResume

    Discussion

    The Connect calls this method when the Service is ready to start executing.

    Services should override this method to perform tasks such as:

  • Display any relevant alerts or dialogs
  • Wire up external event handlers
  • Listening for GPS updates *

  • Declared In

    SIKIServiceEvents.h

    – onFinish required method

    • This is the final method that is called on a Service instance before it�s destroyed and completely removed from memory.

    There will be no lifecycle methods called after the Activity has been destroyed.

    - (void)onFinish

    Discussion

    • This is the final method that is called on a Service instance before it�s destroyed and completely removed from memory.

    There will be no lifecycle methods called after the Activity has been destroyed.

    Declared In

    SIKIServiceEvents.h

    – onRequestInvoke: required method

    This method is called before Service calls Web Service Request.

    - (void)onRequestInvoke:(id<SIKIConnectionRequest>)connectionRequest

    Parameters

    connectionRequest

    IConnectionRequest instance

    Discussion

    This method is called before Service calls Web Service Request.

    Declared In

    SIKIServiceEvents.h

    – onRequestFinish: required method

    This method is called after Web Service Request is executed.

    - (void)onRequestFinish:(id<SIKIConnectionResponse>)connectionResponse

    Parameters

    connectionResponse

    IConnectionResponse instance

    Discussion

    This method is called after Web Service Request is executed.

    Declared In

    SIKIServiceEvents.h

    – onTerminate: required method

    • This method is called when there is any exception while executing the service.

    Once this is called the service will be terminated and release from the memory. * @param serviceException

    - (void)onTerminate:(SIKServiceException *)serviceException

    Discussion

    • This method is called when there is any exception while executing the service.

    Once this is called the service will be terminated and release from the memory. * @param serviceException

    Declared In

    SIKIServiceEvents.h