cordova-plugin-buildinfo
cordova-plugin-buildinfo copied to clipboard
BuildInfo not populated when onDeviceReady fires.
document.addEventListener("deviceready", function () {
console.log (JSON.stringify(BuildInfo));
}, false);
Results in:
BuildInfo init: 0.0066 sec(6641791 nsec): Return
{"packageName":"","basePackageName":"","displayName":"","name":"","version":"","versionCode":0,"debug":false,"buildDate":"","installDate":"","buildType":"","flavor":""}
Cordova 7.1.0 cordovia-ios 4.5.4
Looks like my own deviceready
event handler is being called before the one from the buildinfo plugin.
Looking at your results, BuildInfo initialization seems to be complete. Nevertheless, output in the console.log seem to return the results of uninitialized.
Is there output like the following in Xcode log etc?
BuildInfo basePackageName: "..."
BuildInfo displayName : "..."
BuildInfo name : "..."
BuildInfo version : "..."
BuildInfo versionCode : "..."
BuildInfo debug : YES or NO
BuildInfo buildType : "..."
BuildInfo buildDate : "..."
BuildInfo installDate : "..."
BuildInfo flavor : "..."
the same problem happens here. I didn't see the debug output in Xcode log like that.
I have the same issue here. Xcode reports all values correctly in its log, but they are not available on deviceready via JavaScript
Check if the following file exists.
[PLUGIN]
- plugins/cordova-plugin-buildinfo/plugin.xml
- plugins/cordova-plugin-buildinfo/www/buildinfo.js
- plugins/cordova-plugin-buildinfo/src/ios/CDVBuildInfo.h
- plugins/cordova-plugin-buildinfo/src/ios/CDVBuildInfo.m
[www]
- platforms/ios/platform_www/plugins/cordova-plugin-buildinfo/www/buildinfo.js
- platforms/ios/www/plugins/cordova-plugin-buildinfo/www/buildinfo.js
[Project]
- platforms/ios/PROJECT_NAME/Plugins/cordova-plugin-buildinfo/CDVBuildInfo.h
- platforms/ios/PROJECT_NAME/Plugins/cordova-plugin-buildinfo/CDVBuildInfo.m
PROJECT_NAME varies depending on the created environment.
If there are missing files, try reinstalling the plugin.
If CFBundleDisplayName cannot be acquired, the plugin may not return a response, and iOS acquisition processing has been changed to the release of v4.0.0.
Please try to upgrade to v4.0.0.
I've experienced the similar issue. It turned out that I need to add gap
in content security policy in the html metadata: https://github.com/apache/cordova-plugin-whitelist#content-security-policy