Giter Site home page Giter Site logo

cordova-plugin-extended-device-information's Introduction

title description
Device
Get device information.

cordova-plugin-extended-device-information

Installation

cordova plugin add cordova-plugin-extended-device-information

Browser Console
cordova.plugins['extended-device-information'].freestorage

Properties

  • device.memory
  • device.cpumhz
  • device.totalstorage
  • device.freestorage

cordova-plugin-extended-device-information's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cordova-plugin-extended-device-information's Issues

empty results

displayed: null (all)

  clickCheck() {
    this.pre += "\n memory:" + this.extendedDeviceInformation.memory;
    this.pre += "\n cpumhz:" + this.extendedDeviceInformation.cpumhz;
    this.pre += "\n totalstorage:" + this.extendedDeviceInformation.totalstorage;
  }

template:

<button ion-button (click)="clickCheck()">check</button>
<pre>{{pre}}</pre>

xiaomi mi6, nexus9

Plugin not found - IONIC 4

Hi, I get the following error trying to access any of the function of the plugin:

Native: tried calling ExtendedDeviceInformation.memory, but the ExtendedDeviceInformation plugin is not installed.

The plugin is present when running ionic cordova plugin list:

cordova-plugin-extended-device-information 2.2.0 "ExtendedDeviceInformation"
I have the following in my app.module.ts:

import { ExtendedDeviceInformation } from '@ionic-native/extended-device-information/ngx';
providers: [
...
ExtendedDeviceInformation,

I am testing on a Galaxy S8+ with Android 9 (Pie)

Here is my Ionic Info:

Ionic:

Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

Cordova:

Cordova CLI : 8.1.2 ([email protected])
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

cordova-res : not installed
native-run : 0.2.6 (update available: 0.2.8)

System:

Android SDK Tools : 26.1.1 (/home/stephane/Android/Sdk)
NodeJS : v10.15.2 (/usr/bin/node)
npm : 6.10.2
OS : Linux 5.0
Thanks a lot !

Runtime Error Uncaught in promise: TypeError: Object(...) is not a function

I am using this in an ionic 3 app and got the above error. Created a new app from template to see if its a dependency related problem but still get the same error. It compiles but when I start the app I see this runtime error. Is this the correct way to use the plugin? I have this in my constructor.

My code:

    this.platform.ready().then(() => {
        console.log('The Memory is: ' + this.extendedDeviceInformation.memory);
    });

Thank you!

I have installed This plugin in new ionic 3 project but showing "plugin not installed "

I have installed This plugin in new ionic 3 project . Make build and run it on my Samsung M30s which have android 9 . But it showing plugin not installed.

APP running on following configuration

Ionic:

Ionic CLI : 5.0.0 (\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)

Utility:

cordova-res : 0.15.1
native-run : 1.1.0

System:

Android SDK Tools : 26.1.1 (\Local\Android\Sdk)
NodeJS : v13.12.0 (nodejs\node.exe)
npm : 6.14.4
OS : Windows 10

cordova plugin list
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-extended-device-information 2.2.0 "ExtendedDeviceInformation"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

issue when cordova-plugin-device is used along with this plugin

Hi Daniel,

I have been working to make use of this plugin in my app without any issues for quite a long time. One new observation I found is that this plugin doesnot work as required when cordova-plugin-device is also installed in the same app.
Upon investigation, I found out that the event name used for cordova channel "onCordovaInfoReady" is same in both the plugins due to which only one of the event is registered. Can you change the name to something else and fix it. I have also included the fix for iOS in the below code.

channel.createSticky('onCordovaInformationReady');
channel.waitForInitialization('onCordovaInformationReady');
channel.onCordovaReady.subscribe(function () {
        if(cordova.platformId === 'android') {
            self.getRAMSize(function(info){
                self.memory = info.memory || 'unknown';
                self.cpumhz = info.cpumhz || 'unknown';
                self.totalstorage = info.totalstorage || 'unknown';
                channel.onCordovaInformationReady.fire();
            }, function(e){
                utils.alert('[ERROR] Error initializing Cordova: ' + e);
            });
        } else {
            channel.onCordovaInformationReady.fire();
        }
    });

Can you also fix the ionic native plugin issue.
Thanks
Uday Kiran

Ionic Native: deviceready did not fire within 5000ms.

When plugin is installed it prevents android app from start. It happens even plugin would not registered on app.module.ts. Cordova platform version android@~6.3.0. Target Android version 7.0, Samsung Galaxy S7

[16:50:43] console.log: Device Data [object Object]
[16:50:51] console.log: [Logging message of provider created two ReplaySubject instances]
[16:50:51] console.log: deviceready has not fired after 5 seconds.
[16:50:51] console.log: Channel not fired: onCordovaInfoReady
[16:50:51] console.warn: Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an
inconsistent state. Try removing plugins from plugins/ and reinstalling them.

Ionic native interface not working with the plugin

Hi Daniel,
This plugin seems to be wrapped in ionic native plugin https://ionicframework.com/docs/native/extended-device-information/

But the variables are always returned null when accessed using the ionic native interface.
"The Memory is: null"

Can you please look into this.

Following is my system config
Ionic:

ionic (Ionic CLI) : 4.0.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.11

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, ios 4.5.5

Thanks

iOS Support

Any chance of adding iOS support in the near future?

Plugin breaks iOS execution.

I have been trying to integrate the plugin. I fell some code changes are to be done in extended-device-information.js file.

Replace channel.onCordovaInfoReady.fire(); with channel.onCordovaReady.fire();

Enclose me.getInfo(function (info) {...} inside if(cordova.platformId === 'android') {...} this helps fix iOS plugin failure issue. ```
if(cordova.platformId === 'android') {
me.getInfo(function (info) {
var buildLabel = cordova.version;
me.memory = info.memory || 'unknown';
me.cpumhz = info.cpumhz || 'unknown';
me.totalstorage = info.totalstorage || 'unknown';

 channel.onCordovaInfoReady.fire();

}, function (e) {
me.available = false;
utils.alert("[ERROR] Error initializing Cordova: " + e);
});
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.