Skip to content

VMXFoundry.OfflineObjects.drop

Offline Objects drop function deletes the database schema along with all its data. Success or failure is reported through callbacks provided to the drop API.

Volt MX Iris (JavaScript)

Signature

VMXFoundry.OfflineObjects.drop(options, successCallback, failureCallback)

Parameters

ParameterTypeDescriptionRequired
optionsJSONDrop options such as device database, encryption passphrase and so on.Yes
successCallbackFunctionThe function is invoked on success.Yes
failureCallbackFunctionThe function is invoked on an error with the cause of failure as an argument.Yes
Option Type Description Required
deviceDbEncryptionKey String Encryption passphrase must be a string of six characters long. For further information, refer Offline Objects Getting Started Guide.

**_Note:*** Not applicable for Mobile Web and Desktop Web channels.
No
deviceDbPath String Device database is created at the given deviceDbPath location. The default Offline Objects database path for Windows Kiosk applications is C:\Users\User\AppData\Local. You can use the deviceDbPath option to override the default path. This options helps you to install more than one Offline enabled application by using the Offline Objects database at desired location.

Important: The default Offline Objects database location for Windows Kiosk is C:\Users\User\AppData\Local\AppID\Database. This impacts application upgrades that were built with the earlier versions of the plugin to retain the existing Offline Objects database, rebuild the Kiosk application with the deviceDbPath option and pass the C:\Users\User\AppData\Local location as an input to the setup, reset, and drop APIs.
No

Return Type

void

Example

function successCallback() {
voltmx.print("Application drop success")
}

function failureCallback(error) {
voltmx.print("Application drop failed with error" + error.code);
}

//Decrypt the device database, if encrypted
var options = {
"deviceDbEncryptionKey": "myencryptionpa$$phrase1"
};

VMXFoundry.OfflineObjects.drop(options, successCallback, failureCallback);

Android (Java)

Signature

void <OfflineObjects>.drop(final HashMap<String, object>options, final VMXCallback callback)

Parameters

ParameterTypeDescriptionRequired
optionsHashMap<String, object>Drop option such as device database, encryption key and so on.Yes
callbackVMXCallbackApplication implements onSuccess and onFailure methods of VMXCallback interface.Yes

Drop Options

Option Type Description Required
deviceDbEncryptionKey String Encryption passphrase must be a string with at least six characters long. Refer Offline Objects Getting Started Guide for more details. No

Return Type

void

Example

VoltMXClient sdk = new VoltMXClient();
IVoltMXApplicationSync appSync = sdk.getOfflineObjects();

//Decrypt the device database if encrypted
HashMap < String, object > options = new HashMap < String, object > ();
options.put("deviceDbEncryptionKey", "myencryptionpa$$phrase1");
appSync.drop(options, new VMXCallback() {
@Override
public void onSuccess(Object object) {
Log.d("Application DROP", "Application drop Successful");
}

    @Override
    public void onFailure(Object error) {
        OfflineObjectsException e = (OfflineObjectsException) error;
        Log.e("Application DROP", "Application drop failed with error:" + e.getMessage());
    }

});

iOS (Objective C)

Signature

void <OfflineObjects> drop:(NSDictionary \*) options onSuccess: VMXSuccessCompletionHandler)OnSuccess  
onFailure:(VMXFailureCompletionHandler)onFailure

Parameters

ParameterTypeDescriptionRequired
optionsNSDictionary<NSString*, id>Drop options such as device database, encryption passphrase and so on.Yes
onSuccessVMXSuccessCompletionHandlerThe function is invoked on success.Yes
onFailureVMXFailureCompletionHandlerThe function is invoked on an error with the cause of failure as an argument.Yes

Setup Options

Option Type Description Required
deviceDbEncryptionKey NSString Encryption passphrase must be a string with at least six characters long. For more details, refer Offline Objects Getting Started Guide. No

Return Type

void

Example

VMXClient _ sdk = [VMXClient sharedClient];
OfflineObjects _ applicationSync = [sdk getOfflineObjects];

//Decrypt the device database if encrypted
NSMutableDictionary < NSString _ , id > _ Options = [NSMutableDictionary new];
[options setObject: @"myencryptionpa$$phrase1"
forKey: @"deviceDbEncryptionKey"
];

VMXSuccessCompletionHandler onSuccess = ^ void(id object) {
NSLog(@"Application drop successful");
};

VMXFailureCompletionHandler onFailure = ^ void(id object) {
NSLog(@"Application drop failed");
};

[applicationSync drop: options
onSuccess: onSuccess
onFailure: onFailure
];