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

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
];