Page 1 of 1
getBuildInfo
Posted:
Mon Aug 17, 2020 4:25 pm
by nic
I am using phonegap version 1.0.9 on Servoy 2020.03.1 and I am trying to get the buildinfo from the svyphonegapPhonegap plugin. Here is my code:
scopes.globals.glb_buildinfo = plugins.svyphonegapPhonegap.getBuildInfo()
I should receive an object with a large array of values, but I receive an object with an array length of 1 and the content is undefined.
Does anyone has an answer for me
Re: getBuildInfo
Posted:
Mon Aug 17, 2020 5:14 pm
by tnguyen
Hi,
Is your code is executed within the callback of the onReady event from solutionopen method?
function onSolutionOpen(arg, queryParams) {
//initialize phonegap module
scopes.phonegap.onSolutionOpen(arg,queryParams, onReadyCallback);
}
function onReadyCallback(){
//device is ready, get information from a plugin
application.output(plugins.svyphonegapPhonegap.getBuildInfo());
}
Re: getBuildInfo
Posted:
Tue Aug 18, 2020 9:04 am
by nic
Yep, here's my complete code :
scopes.phonegap.onSolutionOpen(arg, queryParams, onReadyCallback);
/**
* @properties={typeid:24,uuid:"9EC15C4A-7709-4E94-9EB4-9596C77F6098"}
*/
function onReadyCallback(){
//device is ready, get information from a plugin
scopes.globals.glb_device = plugins.svyphonegapDevice.getDeviceInfo()
application.output('1 UUID=' + scopes.globals.glb_device.uuid, LOGGINGLEVEL.INFO)
scopes.globals.glb_device_uuid = plugins.svyphonegapDevice.getDeviceInfoProperty('uuid')
application.output('2 UUID=' + scopes.globals.glb_device_uuid, LOGGINGLEVEL.INFO)
scopes.globals.glb_buildinfo = plugins.svyphonegapPhonegap.getBuildInfo()
application.output('1 buildinfo=' + scopes.globals.glb_buildinfo, LOGGINGLEVEL.INFO)
application.output('2 buildinfo=' + scopes.globals.glb_buildinfo.toString(), LOGGINGLEVEL.INFO)
application.output('3 buildinfo=' + scopes.globals.glb_buildinfo.length, LOGGINGLEVEL.INFO)
application.output('4 buildinfo=' + scopes.globals.glb_buildinfo[1], LOGGINGLEVEL.INFO)
application.output('name=' + scopes.globals.glb_buildinfo.name, LOGGINGLEVEL.INFO)
application.output('version=' + scopes.globals.glb_buildinfo.version, LOGGINGLEVEL.INFO)
application.output('code=' + scopes.globals.glb_buildinfo.versionCode, LOGGINGLEVEL.INFO)
plugins.svyphonegapPhonegap.setOnBackMethod(onBackMethod)
plugins.svyphonegapPhonegap.setOnPauseMethod(onPauseMethod)
plugins.svyphonegapPhonegap.setOnResumeMethod(onResumeMethod)
}
I get an object with an array of 1, but content is undefined
Nic
Re: getBuildInfo
Posted:
Tue Aug 18, 2020 4:55 pm
by tnguyen
Which device(s) are you testing on?
How are you creating the .apk or .ipa?
Are you using the following link to create the template?
https://phonegaputils.servoy.com/soluti ... index.html
Re: getBuildInfo
Posted:
Wed Aug 19, 2020 11:45 am
by nic
I am testing on a Samsung S7 Android device. I created the config.xml with the Servoy utility.
Re: getBuildInfo
Posted:
Wed Aug 19, 2020 5:48 pm
by tnguyen
Can you send me a private message with the config.xml used?
Also, do any of the other phonegap functions work? Such as the back button or other native integrations ?
I would like to review that item over.