Search code examples
cordovagoogle-cloud-messagingcordova-plugins

The relation for cordova version , android device version and GCM version


I plan to use Cordova and Cordova push plugin to implement the GCM. When I tried a demo (Cordova 5) running on an emulator of Android 4.1.2, it reminds me to update the google play service.

Now I'm a little confused. If I want my app can be run from Android 4.1.2 should I change the Cordova platform to android 4.1.2? And actually there is no Cordova android 4.1.2. Only 4.1.1 exists. And I can't build the app with the platform [email protected]. I guess because I didn't install the Android sdk 4.1.1, right? Can I use the Cordova android platform 5.1.1 to build my app which is for running on Android 4.1.2? How should I do if I don't want my users to update the google play service?

And another question is if my app which developed by Cordova doesn't start (nothing in foreground and background), can the system receive the message and awake my app. The native android app(developed by Android Studio) can do it right?

Thanks.


Solution

  • Android API levels supported by Cordova Android platform can be found in the documentation:

    Cordova for Android requires the Android SDK which can be installed on OS X, Linux or Windows. See the Android SDK's System Requirements. Cordova's latest Android package supports up to Android API-Level 23. The supported Android API-Levels for the past few cordova-android releases can be found in this table:

    |cordova-android Version|Supported Android API-Levels| |--|--| |5.X.X|14 - 23| |4.1.X|14 - 22| |4.0.X|10 - 22| |3.7.X|10 - 21|

    Android 4.1.2 = API Level 16 so any cordova-android (as of now) should support it.

    Cordova 5 or 6 or 6.4.0 - is CLI version, which also means the version of the base library used (cordova-lib). Each Cordova version has different defaults for platforms and plugins versions, installed through CLI (i.e. when you do cordova platform add android it will take "pinned" version of the platform, which depends on CLI version).

    Regarding the the google play service - is not the warning just about Android SDK update on your dev machine?