You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/09/02 11:36:24 UTC

[GitHub] [cordova-plugin-battery-status] sbrannstrom edited a comment on issue #66: Conflicts with cordova-plugin-firebase

sbrannstrom edited a comment on issue #66: Conflicts with cordova-plugin-firebase
URL: https://github.com/apache/cordova-plugin-battery-status/issues/66#issuecomment-527114890
 
 
   Thanks @cyptus but it's not working....
   
   I'm calling this function from ngOnInit():
   ```  
   batteryStatus() {
       fromEvent<BatteryStatusResponse>(window, 'batterystatus').subscribe(async (status) => {
         this.batteryStats = status.level;
         console.log('Battery status: ', status);
         if (status.level !== null) {
           this.userService.updateUser({ batteryStatus: this.batteryStats });
         }
       });
     }
   ```
   console logs this:
   ```
   [console.log]: "Battery status : " {
   "isTrusted": false,
   "level": null,
   "isPlugged": false
   }
   ```
   
   I don't know if I'm doing anything wrong but I can't get it to work at all.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org