adding support for webclip uninstallation for ios

revert-dabc3590
inoshperera 8 years ago
parent c8a8bcc341
commit e25e9fd4a1

@ -73,7 +73,8 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
getDevicesOfUser(userName); getDevicesOfUser(userName);
for (org.wso2.carbon.device.mgt.common.Device device : deviceList) { for (org.wso2.carbon.device.mgt.common.Device device : deviceList) {
if(applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){ if(MDMAppConstants.WEBAPP.equals(applicationOperationAction.getApp().getPlatform()) ||
applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){
deviceIdentifiers.add(getDeviceIdentifierByDevice(device)); deviceIdentifiers.add(getDeviceIdentifierByDevice(device));
} }
} }
@ -176,8 +177,11 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
operation = operation =
IOSApplicationOperationUtil.createInstallAppOperation(mobileApp); IOSApplicationOperationUtil.createInstallAppOperation(mobileApp);
} else { } else {
operation = if (MDMAppConstants.WEBAPP.equals(app.getPlatform())) {
IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp); operation = IOSApplicationOperationUtil.createWebClipUninstallOperation(mobileApp);
} else {
operation = IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp);
}
} }
} }
activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId()) activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())

@ -23,6 +23,15 @@ import java.io.Serializable;
public class RemoveApplication implements Serializable { public class RemoveApplication implements Serializable {
private String bundleId; private String bundleId;
private String url;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getBundleId() { public String getBundleId() {
return bundleId; return bundleId;

@ -111,4 +111,22 @@ public class IOSApplicationOperationUtil {
return operation; return operation;
} }
/**
* Create uninstall operations for webclip.
*
* @param application
* @return Uninstall operation
* @throws DeviceApplicationException
*/
public static Operation createWebClipUninstallOperation(MobileApp application) throws
DeviceApplicationException {
ProfileOperation operation = new ProfileOperation();
operation.setCode(MDMAppConstants.IOSConstants.OPCODE_REMOVE_APPLICATION);
operation.setType(Operation.Type.PROFILE);
RemoveApplication removeApplication = new RemoveApplication();
removeApplication.setUrl(application.getIdentifier());
operation.setPayLoad(removeApplication.toJSON());
return operation;
}
} }

Loading…
Cancel
Save