How to use the ionic-native.AppVersion.getAppName function in ionic-native

To help you get started, we’ve selected a few ionic-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NorthMcCormick / Polyonic / src / src / pages / page1 / page1.ts View on Github external
AppVersion.getVersionNumber().then((value) => {
      this.appVersion = value;
      console.log(value);
    }, (error) => {
      console.error(error);
    })

    AppVersion.getPackageName().then((value) => {
      this.appPackageName = value;
      console.log(value);
    }, (error) => {
      console.error(error);
    })

    AppVersion.getAppName().then((value) => {
      this.appName = value;
      console.log(value);
    }, (error) => {
      console.error(error);
    })

    AppVersion.getVersionCode().then((value) => {
      this.appVersionCode = value;
      console.log(value);
    }, (error) => {
      console.error(error);
    })
  }
github zyra / ionic-native-playground / app / pages / main / main.ts View on Github external
let _resolved_count = 0,
            _called_count = 0;
        let name, package_name, version_number, version_code;
        let output = () => {
            _called_count++;
            if(_called_count===4 && _resolved_count === 0) {
                this.updateOutput('Error getting version number.', true);
                return;
            }
            if(_resolved_count<4 && _called_count <4) return;
            this.updateOutput("App name: " + name + "" +
                "<br>Package name: " + package_name + "" +
                "<br>App Version: " + version_number + "" +
                "<br>Version Code: " + version_code);
        }
        AppVersion.getAppName().then((data) =&gt; {
            _resolved_count++;
            name = data;
            output();
        }, ()=&gt;output());

        AppVersion.getPackageName().then((data) =&gt; {
            _resolved_count++;
            package_name = data;
            output();
        }, ()=&gt;output());

        AppVersion.getVersionNumber().then(data=&gt;{
            _resolved_count++;
            version_number = data;
            output();
        }, ()=&gt;output());