How to get group channel "Data" field in push notification

Hi i have created the group channel and added the Data filed while creating the channel, i want that data filed while i receive the push notification.

If its not possible with data so is there is any way to get the costume value group specific in Push Notification.

GroupChannelParams →

{
mUserIds=[
hulk
],
mOperatorUserIds=[
manishahire
],
mIsSuper=null,
mIsPublic=null,
mIsEphemeral=null,
mIsDistinct=false,
mIsDiscoverable=null,
mChannelUrl=‘null’,
mName=’’,
mCoverUrlOrImage=,
mData=’{
“EventKey”: “XXXXXXXXXXXXXXXXXXXXXXXXXXXX”
}’,
mCustomType=‘null’,
mAccessCode=‘null’,
mStrict=null,
isBroadcast=null,
messageSurvivalSeconds=null
}

Current Push Notification →

{
“sqs_ts”: 1640178506858,
“custom_type”: “”,
“channel”: {
“channel_unread_message_count”: 4,
“custom_type”: “”,
“name”: “”,
“channel_url”: “sendbird_group_channel_255145088_913b20a9a9a2c9c792041c83d89bc82be96e6efc”
},
“created_at”: 1640178506538,
“message_id”: 7196664369,
“message”: “Hi”,
“type”: “MESG”,
“unread_message_count”: 4,
“push_title”: null,
“audience_type”: “only”,
“sender”: {
“require_auth_for_profile_image”: false,
“profile_url”: “”,
“name”: “Manish Ahire”,
“id”: “manishahire”
},
“push_sound”: “default”,
“translations”: {

},
“recipient”: {
“name”: “Burce Banner”,
“push_template”: “default”,
“id”: “hulk”
},
“files”: [

],
“category”: “messaging:offline_notification”,
“channel_type”: “group_messaging”,
“mentioned_users”: [

],
“app_id”: “03A86B6C-2DA7-45DA-90DA-C89CEBC29492”
}

Unfortunately, we just provide below

{
    "category": "messaging:offline_notification",
    "type": string,                 // Message type: 'MESG', 'FILE', or 'ADMM'
    "message": string,              // User input message
    "custom_type": string,          // Custom message type
    "message_id": long,             // Message ID
    "created_at": long,             // The time that the message was created, in a 13-digit Unix milliseconds format
    "app_id": string,               // Application's unique ID
    "unread_message_count": int,    // Total number of new messages unread by the user
    "channel": {
        "channel_url": string,      // Group channel URL
        "name": string,             // Group channel name
        "custom_type": string       // Custom Group channel type
        "channel_unread_count": int // Total number of unread new messages from the specific channel
    },
    "channel_type": string,         // The value of "channel_type" is set by the system. The 'messaging' indicates a distinct group channel while 'group_messaging' indicates a private group channel and 'chat' indicates all other cases.
    "sender": {
        "id": string,               // Sender's unique ID
        "name": string,             // Sender's nickname
        "profile_url": string       // Sender's profile image URL
        "require_auth_for_profile_image": false,
        "metadata": {}
    },
    "recipient": {
        "id": string,               // Recipient's unique ID
        "name": string              // Recipient's nickname
    },
    "files": [],                    // An array of data regarding the file message, such as filename
    "translations": {},             // The items of locale:translation.
    "push_title": string,           // Title of a notification message that can be customized in the Sendbird Dashboard with or without variables
    "push_sound": string,           // The location of a sound file for notifications
    "audience_type": string,        // The type of audiences for notifications
    "mentioned_users": {
        "user_id": string,          // The ID of a mentioned user
        "nickname": string,         // The nickname of a mentioned user
        "profile_url": string,      // Mentioned user's profile image URL
        "require_auth_for_profile_image": false
    },
}

I think if you create your own channel url with event key, you can retrieve event key from channel url.

Hi @Doo_Rim,

Sender -> metadata field is also works for me but now its not coming with push notification object.
My Sender User Object.

{
  "phone_number": "",
  "has_ever_logged_in": true,
  "discovery_keys": [
    
  ],
  "require_auth_for_profile_image": false,
  "access_token": "",
  "preferred_languages": [
    
  ],
  "created_at": 1640169657,
  "is_active": true,
  "locale": "",
  "is_hide_me_from_friends": false,
  "session_tokens": [
    
  ],
  "is_online": false,
  "user_id": "manishahire",
  "last_seen_at": 1640236215067,
  "is_shadow_blocked": false,
  "nickname": "Manish Ahire",
  "profile_url": "",
  "metadata": {
    "EventKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "UserProfileKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
}

and received notification object.

{
  "sqs_ts": 1640236326947,
  "custom_type": "",
  "channel": {
    "channel_unread_message_count": 1,
    "custom_type": "",
    "name": "",
    "channel_url": "sendbird_group_channel_255145088_913b20a9a9a2c9c792041c83d89bc82be96e6efc"
  },
  "created_at": 1640236326649,
  "message_id": 7198369311,
  "message": "Hiii",
  "type": "MESG",
  "unread_message_count": 1,
  "push_title": null,
  "audience_type": "only",
  "sender": {
    "require_auth_for_profile_image": false,
    "profile_url": "",
    "name": "Burce Banner",
    "id": "hulk"
  },
  "push_sound": "default",
  "translations": {
    
  },
  "recipient": {
    "name": "Manish Ahire",
    "push_template": "default",
    "id": "manishahire"
  },
  "files": [
    
  ],
  "category": "messaging:offline_notification",
  "channel_type": "group_messaging",
  "mentioned_users": [
    
  ],
  "app_id": "03A86B6C-2DA7-45DA-90DA-C89CEBC29492"
}

How to get "metadata" object in Sender Object while receiving the Notifications

Okay, I will check it :slight_smile:

I think your user id is different between your Sender obj (manishahire) and notification sender obj (hulk).

Hi i have added the metadata for both the user, hulk and manishahire

you can check new notification object for sender manishahire

{
  "sqs_ts": 1640238767566,
  "custom_type": "",
  "channel": {
    "channel_unread_message_count": 1,
    "custom_type": "",
    "name": "",
    "channel_url": "sendbird_group_channel_255145088_913b20a9a9a2c9c792041c83d89bc82be96e6efc"
  },
  "created_at": 1640238767260,
  "message_id": 7198460693,
  "message": "Hi",
  "type": "MESG",
  "unread_message_count": 1,
  "push_title": null,
  "audience_type": "only",
  "sender": {
    "require_auth_for_profile_image": false,
    "profile_url": "",
    "name": "Manish Ahire",
    "id": "manishahire"
  },
  "push_sound": "default",
  "translations": {
    
  },
  "recipient": {
    "name": "Burce Banner",
    "push_template": "default",
    "id": "hulk"
  },
  "files": [
    
  ],
  "category": "messaging:offline_notification",
  "channel_type": "group_messaging",
  "mentioned_users": [
    
  ],
  "app_id": "03A86B6C-2DA7-45DA-90DA-C89CEBC29492"
}


Hi @Doo_Rim any solutions for push notification meta data values.

Hi @manishahire ,

Currently, you should retrieve user instance or channel instance by using userId, channelUrl…!
I am checking this issue with server team. If I get new updates, I will let you know!

Hi @manishahire

I got how you can enable the metadata. Application has the attribute such as application.attrs.push_payload.include_sender_metadata.

If you want to turn on this attribute, you should contact our solution engineering team. Please request this issue to our solution engineering team!