Installation and initialization

AppMetrica Push Cordova is a plugin for the Cordova (PhoneGap) platform that includes support for the AppMetrica Push SDK for Android and iOS through the JavaScript interface.

Before using the AppMetrica Push Cordova plugin, you need to enable and initialize the AppMetrica Cordova plugin version 0.2.0 or later.

  1. Integrating the plugin
  2. Connection examples
  3. API methods

Integrating the plugin

Step 1. Add the supported platforms to your project

Step 2. Add the plugin to the project by using one of the following console commands:
cordova plugin add yandex-appmetrica-push-plugin-cordova
Copied to clipboard
or
cordova plugin add https://github.com/yandexmobile/metrica-push-plugin-cordova.git
Copied to clipboard

When you add another supported platform to the project, the plugin automatically downloads the corresponding SDK library.

Step 3. (For Android projects only) Add the following to the application element of the AndroidManifest.xml file:

<meta-data android:name="ymp_gcm_project_number" android:value="number: