Setup Push Notifications

Push Notifications

You can enable Luciq to send your users push notifications each time you send them a new message.

Push Notification Key

Follow the steps below to upload your push certificate to your Luciq dashboard.

  1. Go to the Push Notifications page on your Luciq dashboard and add you API_KEY.

  2. Make sure to select whether the API_KEY you're adding is for development or production.

Setting Your App to Handle Luciq Notifications

Pass the push notification registration token you get to Luciq.

When you receive a notification, check if it's an Luciq notification, then pass it to Luciq if necessary.

Notification Channel ID

You can use channels to group the incoming Luciq notifications into a manageable group. To do this, you simply need to pass the channel ID to the below API.

Notification Icon

The icon that is shown with each push notification can be changed to match your application's icon. The API below can be used to change this icon.

Disabling Push Notifications

Push notifications are enabled by default if you upload a push certificate to your Luciq dashboard. To disable them, modify your builder method as in the following example.

In-App Notifications

By default, a notification will be shown on top of your app's UI when a new message is received.

Email Notifications

If your user doesn't view the new message within 10 minutes, they will be sent an email notification as well.

Disabling In-App Notifications

Use the following method to disable notifications that appear in-app.

In-App Notification Sound

When your app users receive an in-app notification through Luciq, sound is enabled by default. However, you can disable it by using the following method.

System Notification Sound

System notification sound is disabled by default. You can enable it by adding the following method to Luciq builder.

Conversation Sound

When your app users receive a new in-app chat in a conversation with you, sound is also enabled by default. You can disable it by adding the following method to Luciq builder.

Get Unread Messages Count

You can use the following method to get the number of messages the user has yet to read.

Upload Service Account File

Google has announced the deprecation of the old FCM APIs that are used for Push Notifications. To ensure better performance and user experience, it is imperative to migrate to the HTTPv1 APIs.

Prepare the service-account.json from Firebase

  1. Go to your Firebase Projects Page by navigating to the Firebase Console.

  2. Select your project from the Firebase console landing page, then select the project you want to update.

  3. Access your project settings by clicking on the gear icon next to the project name to open Project Settings.

  4. Generate a new private key by doing the following:

    1. Go to the Service Accounts tab

    2. Click on the Generate new private key button

Confirming your action

A file named <your-project>-firebase-adminsdk-<first-numbers-of-your-key>.json will be downloaded. This is your service-account.json file.

Configure Push Notifications in Luciq Dashboard

  1. Select the App and Environment you need to configure push notifications for.

  2. Navigate to Settings by clicking on Settings in the left sidebar.

  3. Under the settings menu, select Push Notification Settings.

  4. Upload the service-account.json file you obtained from Firebase in the previous steps.

  5. Update to the latest Luciq SDK version to leverage the new push notification features.

Last updated