Error message: "Tokens not registered for user" when trying to POST to `v1/user-settings`

Getting the following error response when trying to POST to https://push-notification-us.cometchat.io/v1/user-settings

{"error":{"message":"Tokens not registered for user.","devMessaeg":"Tokens not registered for user.","code":"ERR_INVALID_OPERATION","source":"ext-api"}}

This is what my request looks like:

    const response = await CometChat.callExtension(
      'push-notification',
      'POST',
      'v1/user-settings',
      {
        'user-settings': {
          dnd: false,
          chat: {
            allow_only_mentions: false,
            mute_group_actions: false,
            mute_all_guids: false,
            mute_all_uids: true,
          },
          call: {
            mute_all_guids: false,
            mute_all_uids: false,
          },
        },
      }
    )

Hello,

You can save settings for users who have their tokens registered.
That is, the user has to be logged in to CometChat and should have FCM or APNs token registered using CometChat.registerTokenForPushNotification method.

It won’t work for users who have not yet registered their Push Notifications tokens.

Hope that helps.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.