adding support for webclip uninstallation for ios

merge-requests/1/head
inoshperera 8 years ago
parent c8a8bcc341
commit e25e9fd4a1

@ -73,7 +73,8 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
getDevicesOfUser(userName);
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));
}
}
@ -176,8 +177,11 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
operation =
IOSApplicationOperationUtil.createInstallAppOperation(mobileApp);
} else {
operation =
IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp);
if (MDMAppConstants.WEBAPP.equals(app.getPlatform())) {
operation = IOSApplicationOperationUtil.createWebClipUninstallOperation(mobileApp);
} else {
operation = IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp);
}
}
}
activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())

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

@ -111,4 +111,22 @@ public class IOSApplicationOperationUtil {
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