Cordova Push

Learn how to handle push notifications in Cordova

Set Up and Register for Push Notifications and Deep Links

iOS

Set up push notifications for your app.

If you plan to use deep links, register your custom URL scheme as described here.

Call the following from your Javascript.

CleverTap.registerPush();

Android

To use Push Notifications out of the box using CleverTap, add the following entries to your AndroidManifest.xml.

<application>
         ....
         ....
        <service android:name="com.clevertap.android.sdk.pushnotification.fcm.FcmMessageListenerService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

 </application>

Creating Notification Channel

CleverTap.createNotificationChannel("CtCS", "Clever Tap Cordova Testing", "CT Cordova Testing", 1, true);

Delete Notification Channel

CleverTap.deleteNotificationChannel("CordovaTesting");

Creating a group notification channel

CleverTap.createNotificationChannelGroup("groupId", "groupName");

Delete a group notification channel

CleverTap.deleteNotificationChannelGroup("groupId");

To use any Activity as a deep link, add your custom URL scheme to the AndroidManifest.xml for that Activity.

<intent-filter android:label="@string/app_name">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="clevertapstarter" />
     </intent-filter>

See example AndroidManifest.xml.