Push Config
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);
Content copied to clipboard
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 :
- Add the swstd aar file to your gradle file :
implementation files('libs/swstd-rXXXX.aar')Content copied to clipboard - 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);Content copied to clipboard - For the implementation :
- register Push notification :
PushNotifManager.registerPushNotif(context);Content copied to clipboard - get Push notification registration status :
boolean status = PushNotifManager.checkPushRegistrationStatus(activity);Content copied to clipboard
- register Push notification :