cordova-plugin-buildinfo icon indicating copy to clipboard operation
cordova-plugin-buildinfo copied to clipboard

BuildInfo not populated when onDeviceReady fires.

Open sgdesmet opened this issue 7 years ago • 7 comments

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

sgdesmet avatar Nov 22 '17 16:11 sgdesmet

Looks like my own deviceready event handler is being called before the one from the buildinfo plugin.

sgdesmet avatar Nov 23 '17 10:11 sgdesmet

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         : "..."

lynrin avatar Nov 24 '17 09:11 lynrin

the same problem happens here. I didn't see the debug output in Xcode log like that.

crysislinux avatar May 31 '18 07:05 crysislinux

I have the same issue here. Xcode reports all values correctly in its log, but they are not available on deviceready via JavaScript

fjaeger avatar Aug 21 '19 17:08 fjaeger

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.

lynrin avatar Aug 25 '19 09:08 lynrin

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.

lynrin avatar Sep 02 '19 03:09 lynrin

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

wti806 avatar Oct 01 '19 23:10 wti806