/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Add an FCM push configuration

    Copy link

    Registers an FCM (Firebase Cloud Messaging) push configuration for client apps. To send push notifications to Android devices, you should first register the FCM push configuration. You can also register the configurations on the Sendbird Dashboard under Settings > Chat > Push notifications.


    Register a service account key

    Copy link

    You can register a service account key for FCM HTTP v1 API on Sendbird Dashboard. For instructions, see this FCM migration guide.


    HTTP request

    Copy link
    POST https://api-{application_id}.sendbird.com/v3/applications/push/fcm
    

    Request body

    Copy link

    The following table lists the properties of an HTTP request that this action supports.

    Properties
    RequiredTypeDescription

    service_account_key

    file

    In the form of a multipart/form-data content type, specifies the name of a .JSON file. Sendbird server scans the content of the file and registers the file as its corresponding type. If you upload a wrong file, you will receive an error.

    OptionalTypeDescription

    push_sound

    string

    Specifies the name of a sound file to be played when a push notification is delivered to client apps. The file should be located in the /res/raw folder.


    Response

    Copy link

    If successful, this action returns the information about the registered FCM push configuration in the response body.

    {
        "push_configurations": [
            {
                "id": "065c7f1c0e98b9eac8792e7da9211ce30e3923f1",
                "push_type": "FCM",
                "created_at": 1596607063,
                "project_id: "sample-app-project",
                "private_key_id": "b17fc85aea21f21e2e3a93f18dd038a9d55f8d84",
                "push_sound": "bird_clock_alarm.swf"
            }
        ]
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    push_configurations[]

    array of objects

    A list of FCM, HMS, or APNs push configurations.

    push_configurations.(provider).id

    string

    A unique provider ID of the push configuration. This is automatically generated by Sendbird.

    push_configurations.(provider).push_type

    string

    The type of the push configuration.

    push_configurations.(provider).project_id

    string

    The project_id of service_account_key.

    push_configurations.(provider).private_key_id

    string

    The push_configurations of service_account_key.

    push_configurations.(provider).push_sound

    string

    The name of a sound file to be played when a push notification is delivered to client apps.

    In the case of an error, an error object is returned. A detailed list of error codes is available here.