PushConfig

open class PushConfig

This class gives the possibility to configure and customise the push notification mechanism using any third library (like Google FCM).

The following example gives an idea how to use and customise the Push notification config :


         PushConfig pushConfig =
             new PushConfig
                 .Builder()
                 .pushConnector(new IPushConnector() {

                     public void initCallback(IPushRegistrator pushRegistrator) {

                     }

                     public void registerInBackground(Context context, ConnectorCallback connectorCallback) {

                     }

                     public boolean checkRegistrationStatus(Activity activity, TokenHandler tokenHandler) {
                        return false;
                     }
                 })
                 .build();

         SDKEnvironment.initPushConfig(pushConfig);
    

In order to use this class with the Google FCM, an existing configuration is done for you and can be used by following these steps :

  1. Add the swstd aar file to your gradle file :
    
             implementation files('libs/swstd-rXXXX.aar')
        
  2. Add this snippet code to initialize the Push notification config using swstd library :
    
             PushConfig pushConfig =
                 new PushConfig
                     .Builder()
                     .pushConnector(new FCMPushConnector())
                     .build();
    
             SDKEnvironment.initSMSConfig(pushConfig);
        
  3. For the implementation :
    1. register Push notification :
      
                           PushNotifManager.registerPushNotif(context);
                      
    2. get Push notification registration status :
      
                           boolean status = PushNotifManager.checkPushRegistrationStatus(activity);
                      

Types

Link copied to clipboard
open class Builder
The type Builder.