Optimize FCM token refreshing #557

Merged
tcdlpds merged 1 commits from pahansith/device-mgt-core:fcm-imprv2 into master 2 months ago

@ -62,7 +62,7 @@ public class FCMNotificationStrategy implements NotificationStrategy {
Device device = FCMDataHolder.getInstance().getDeviceManagementProviderService() Device device = FCMDataHolder.getInstance().getDeviceManagementProviderService()
.getDeviceWithTypeProperties(ctx.getDeviceId()); .getDeviceWithTypeProperties(ctx.getDeviceId());
if(device.getProperties() != null && getFCMToken(device.getProperties()) != null) { if(device.getProperties() != null && getFCMToken(device.getProperties()) != null) {
FCMUtil.getInstance().getDefaultApplication().refresh(); FCMUtil.getInstance().getDefaultApplication().refreshIfExpired();
sendWakeUpCall(FCMUtil.getInstance().getDefaultApplication().getAccessToken().getTokenValue(), sendWakeUpCall(FCMUtil.getInstance().getDefaultApplication().getAccessToken().getTokenValue(),
getFCMToken(device.getProperties())); getFCMToken(device.getProperties()));
} }

Loading…
Cancel
Save