WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Success and Failure not called after setConfig #146

@mrwrighty

Description

@mrwrighty

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions