React Native Push

Learn how to handle push notifications in React Native.

Push Notifications

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("CtRNS", "Clever Tap React Native Testing", "CT React Native Testing", 1, true);

Delete Notification Channel

CleverTap.deleteNotificationChannel("RNTesting");

Creating a group notification channel

CleverTap.createNotificationChannelGroup(String groupId, String groupName);

Delete a group notification channel

CleverTap.deleteNotificationChannelGroup(String groupId);

iOS

To set up and register for push notifications complete the following steps:

  1. Set up push notifications for your app.

  2. Call the following from your JavaScript.

CleverTap.registerForPush();

Did this page help you?