Twilio
We have partnered with Twilio for sending SMS Notifications so need to set up an account on Twilio before you start using the extension.Create a new App on Twilio
- Once you log in to Twilio, create a new app.
- Make a note of Account SID and Auth Token for later use.
- Click on “Get a Trial number” to get the Sender number. (Use the paid number if you already have one)
- Make a note of the sender’s phone number for later use.
Store contact details
Store the phone number of your users by using our Update Contact details API.Enable SMS Notifications

- Login to CometChat dashboard and select your app.
- Navigate to Notifications > Notifications in the left-hand menu.
- Enable SMS notifications feature.
Save Twilio credentials

- Twilio Account SID
- Twilio Auth token
- Twilio sender phone number
Save user’s timezone
A user’s timezone is required to allow them to set a schedule for receiving notifications. In case the timezone is not registered, the default timezone for- For US region: EST
- For EU region: GMT
- For IN region: Asia/Kolkata
updateTimezone()
method of CometChatNotifications
class.
This functionality is available in the following SDK versions:
- Android SDK version 4.0.9 and above
- iOS SDK version 4.0.51 and above
- Web SDK version 4.0.8 and above
- React Native SDK version 4.0.10 and above
- Ionic Cordova SDK version 4.0.8 and above
- Flutter SDK version 4.0.15 and above
Receive notifications

Custom SMS provider
Custom provider allows you to make use of providers apart from Twilio for triggering SMS notifications. This is implemented using webhook URL which gets all the required details that can be used to trigger SMS notifications.Pre-requisite
- Your webhook endpoint must be accessible over
HTTPS
. This is essential to ensure the security and integrity of data transmission. - This URL should be publicly accessible from the internet.
- Ensure that your endpoint supports the
HTTP POST
method. Event payloads will be delivered viaHTTP POST
requests inJSON
format. - Configure your endpoint to respond immediately to the CometChat server with a 200 OK response. The response should be sent within 2 seconds of receiving the request.
- For security, it is recommended to set up Basic Authentication that is usually used for server-to-server calls. This requires you to configure a username and password. Whenever your webhook URL is triggered, the HTTP Header will contain:
Add credentials
- Click on the ”+ Add Credentials” button.
- Enable the provider.
- Enter the publically accessible Webhook URL.
- It is recommended to enable Basic Authentication.
- Enter the username and password.
- Enabling the “Trigger only if phone number is stored with CometChat” setting requires users’ phone numbers to be stored with CometChat using the Update Contact details API. When enabled, the webhook is triggered only for those users. If this setting is disabled, the webhook triggers regardless of whether users’ phone numbers are stored with CometChat.
- Save the credentials.
