nativescript-background-geolocation-lt icon indicating copy to clipboard operation
nativescript-background-geolocation-lt copied to clipboard

Success and Failure not called after setConfig

Open mrwrighty opened this issue 6 years ago • 0 comments

Your Environment

  • Plugin version: 1.9.1
  • Platform: iOS
  • OS version: 12.1.4
  • Device manufacturer / model: Apple iPhone X
  • Nativescript version (tns info): 5.2.0
  • Plugin config

Expected Behavior

Turn on and off the debug feature

Actual Behavior

Success and failure functions not firing after setConfig

Steps to Reproduce

This code is in main-page.js with main_view_model_1 loaded with geolocation content as per demo.

exports.changedebug = function (args){ var page = args.object; var debugstate = appSettings.getBoolean("DebugState"); if (debugstate == false){ dialogs.prompt({ title: "Enable Debug Mode", message: "Enter Admin password to enable debug mode.", cancelButtonText: "Cancel", okButtonText: "Continue", password: "Enter password", inputType: dialogs.inputType.password }).then(function (r){ console.log("Login result: " + r.result) if (r.result && r.text == "d3bug0n"){ nativescript_background_geolocation_lt_1.BackgroundGeolocation.setConfig({ debug: true }, function(){ alert("Debug now on"); appSettings.setBoolean("DebugState", true); var DebugIcon = args.object.page.getViewById("debugicon"); DebugIcon.src = "~/images/debug-on.png"; }, function(){ alert("Enable Debug failed."); }); } }); } else{ dialogs.prompt({ title: "Disable Debug Mode", message: "Enter Admin password to disable debug mode.", cancelButtonText: "Cancel", okButtonText: "Continue", password: "Enter password", inputType: dialogs.inputType.password }).then(function (r){ console.log("Login result: " + r.result) if (r.result && r.text == "d3bug0ff"){ nativescript_background_geolocation_lt_1.BackgroundGeolocation.setConfig({ debug: false }, function(){ alert("Debug now off"); appSettings.setBoolean("DebugState", false); var DebugIcon = args.object.page.getViewById("debugicon"); DebugIcon.src = "~/images/debug-off.png"; }, function(){ alert("Debug off failed."); }); } }); } page.bindingContext = new main_view_model_1.HelloWorldModel(); }

Context

Enable and Disable debug within the app

Debug logs

mrwrighty avatar Mar 12 '19 11:03 mrwrighty