Skip to content
Siminov Framework edited this page Jan 17, 2016 · 5 revisions

Siminov Framework provides few event notifiers which gets triggered based on particular action. Application have to provide implementation for these event notifiers and register them with Siminov.

Note

  • Event Handler: It can be define in both Native and Web.

  • Native Event Handler: If you want to handle Event in Native then define Event Handler using Native language. Specify full model class path and name in ApplicationDescriptor.xml.

  • Hybrid Event Handler: If you want to handle Event in Web then define Event Handler using JavaScript. Specify only JavaScript Function name in ApplicationDescriptor.xml.

  • Both (Native/Hybrid) Event Handler: If you want to handle Event in both Native and Web then define Event Handler in both Native and JavaScript. Specify full model class path and name in ApplicationDescriptor.xml, no need to define for JavaScript because Siminov will automatically assume same name for it.

Android API: Notification Events

    public interface INotificationEvents {

        public void onRegistration(IRegistration registration);

        public void onUnregistration(IRegistration registration);

        public void onNotification(IMessage message);
	
        public void onError(NotificationException notificationException);
    }

iOS API: Notification Events

    @protocol SIKINotificationEvents <NSObject>

    - (void)onRegistration:(id<SIKIRegistration>)registration;

    - (void)onUnregistration:(id<SIKIRegistration>)registration;

    - (void)onNotification:(id<SIKIMessage>)message;
	 
    - (void)onError:(SIKNotificationException *)notificationException;

    @end

Windows API: Notification Events

    public interface INotificationEvents {

        void OnRegistration(IRegistration registration);

        void OnUnregistration(IRegistration registration);

        void OnNotification(IMessage message);
	
        void OnError(NotificationException notificationException);
    }

JavaScript API: Notification Events

    function INotificationEvents() {

        this.onRegistration = function(registration) {};

        this.onUnregistration = function(registration) {};

        this.onNotification = function(message) {};
	
        this.onError = function(notificationException) {};
    }
1. On Registration - [Android:onRegistration | iOS:onRegistration | Windows:OnRegistration | JavaScript:onRegistration]

This is the first method to be called when application is successfully registered with push notification platform service.

2. On Unregistration - [Android:onUnregistration | iOS:onUnregistration | Windows:OnUnregistration | JavaScript:onUnregistration]

This method is called when application get unregistered on the push notification platform.

3. On Notification - [Android:onNotification | iOS:onNotification | Windows:OnNotification | JavaScript:onNotification]

This method is called when application gets any message/notification from server.

4. On Error - [Android:onError | iOS:onError | Windows:OnError | JavaScript:onError]

This method is called if there is any error in process of registration/notification.

4. On Terminate - [Android:onTerminate | iOS:onTerminate | Windows:OnTerminate | JavaScript:onTerminate]

This method is called if there is any error/exception while synchronizing data with web service.