))

int

batteryLevel

getBatteryLevel

();

if

batteryLevel

!=

result

success

batteryLevel

);

else

result

error

"UNAVAILABLE"

"Battery level not available."

null

);

else

result

notImplemented

();

You should now be able to run the app on Android. If using the Android
Emulator, set the battery level in the Extended Controls panel
accessible from the … button in the toolbar.

Step 4: Add an iOS platform-specific implementation

Swift

Objective-C