Mobile: Support for completely client-side actions
The mobile platform now supports the functionality to handle actions entirely client-side using the mechanical turk. This prevents possible issues when triggering certain actions when being offline.
This can be accomplished by returning “NO_SERVER_ACTION” in the beforeAction method in the mechanical-turk.js file. See an example below:
// It is possible to prevent an action to be sent to the server
// by returning the value "NO_SERVER_ACTION" in the function below.
// This can be useful when all the logic behind the action
// is implemented in the mechanical turk.
beforeAction:function(id, action) {
if (action.label === "Some specific label") {
// do what you have to do
…
// and return the flag
return "NO_SERVER_ACTION";
}
},