From 8fbe1a4234e9aea185b4b0c803e61f39476e5ffc Mon Sep 17 00:00:00 2001 From: aselarbd Date: Fri, 7 Sep 2018 14:56:31 +0530 Subject: [PATCH] This is the fix for the enrollment error occurred when a user enrols android device to EMM 2.2.0 in FCM enabled environment if whitelist policy is enforced. Please find the GitHub issue from [1] [1]: https://github.com/wso2/product-iots/issues/1827 --- .../notification/provider/fcm/FCMNotificationStrategy.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java index 83a9289442f..7c1700c2108 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java @@ -64,7 +64,9 @@ public class FCMNotificationStrategy implements NotificationStrategy { if (NOTIFIER_TYPE_FCM.equals(config.getType())) { Device device = FCMDataHolder.getInstance().getDeviceManagementProviderService() .getDeviceWithTypeProperties(ctx.getDeviceId()); - this.sendWakeUpCall(ctx.getOperation().getCode(), device); + if(getFCMToken(device.getProperties()) != null) { + this.sendWakeUpCall(ctx.getOperation().getCode(), device); + } } else { if (log.isDebugEnabled()) { log.debug("Not using FCM notifier as notifier type is set to " + config.getType() +