Integrate the Cordova Plugin with Capacitor or Ionic Apps
Use the Cordova Plugin to integrate the MobilePush SDK into Ionic and Capacitor applications. For detailed installation and setup instructions, see Marketing Cloud Cordova Plugin.
To integrate Capacitor or Ionic apps with the MobilePush SDK, configure the Cordova plugin by modifying your application’s configuration file.
For Ionic apps, modify the capacitor.config.ts file and add preferences under cordova, as shown in this example.
For Capacitor apps, modify the capacitor.config.json file and add preferences under cordova, as shown in this example.
Complete these steps each time you add the platform to your Capacitor app.
Copy the google-services.json file into the YOUR_APP/android/app/ directory.
-
Enable push notifications in your target’s Capabilities settings in Xcode by clicking + Capability and then selecting Push Notifications.

-
Enable iOS push notifications by adding this code to
AppDelegate.Additionally, add this code to the end of the
AppDelegate.swiftfile.
If you use TypeScript with your app, declare the plugin before you call the APIs, as shown in this example.