Advanced
You can set up some advanced features based on your requirements.
Get FCM Token
To obtain the FCM token of the user from the SDK, add the given snippet as per the requirement.
SmartPush.getInstance(new WeakReference<>(context)).getDevicePushToken();
SmartPush.getInstance(WeakReference(context)).getDevicePushToken()
SmartechSDK.getDevicePushToken((error, devicePushToken) => {
//Grab the devicePushToken
});
Fetching existing tokens from FCM
Important
This step is required only for SmartPush - version 3.3.1 and below.
To obtain an already generated token by Application, we can use the below method to get the existing token.
SmartPush.getInstance(new WeakReference<>(context)).fetchAlreadyGeneratedTokenFromFCM();
SmartPush.getInstance(WeakReference(context)).fetchAlreadyGeneratedTokenFromFCM()
SmartechSDK.fetchAlreadyGeneratedTokenFromFCM()
Get GUID
To get the GUID which CE\E SDK uses to identify the user, you can call the getGUID()
method.
String guid = Smartech.getInstance(new WeakReference<>(context)).getDeviceUniqueId();
val guid=Smartech.getInstance(WeakReference(context)).getDeviceUniqueId()
SmartechSDK.getDeviceGuid((error, deviceGuid) => {
//Grab the deviceGuid
});
Debugging
To check the logs of CEE SDK, you must implement a method named setDebugLevel(). By default, the debug level will be None.
Below are the Log levels.
LOG_LEVEL_VERBOSE
LOG_LEVEL_DEBUG
LOG_LEVEL_INFO
LOG_LEVEL_WARN
LOG_LEVEL_ERROR
LOG_LEVEL_FATAL
LOG_LEVEL_NONE
Smartech smartech = Smartech.getInstance(new WeakReference<>(this.getApplicationContext()));
smartech.setDebugLevel(SMTDebugLevel.Level.VERBOSE);
val smartech = Smartech.getInstance(WeakReference(this.getApplicationContext()))
smartech.setDebugLevel(SMTDebugLevel.Level.LOG_LEVEL_DEBUG)
Updated about 1 month ago