# iOS Chat SDK: Error 800130 while trying to mark message as delivered

**URL:** https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932
**Category:** iOS
**Created:** [February 11, 2022, 9:21am UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932 "2022-02-11T09:21:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Neskodi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/neskodi/32/2027_2.png) [@Neskodi](https://community.sendbird.com/u/Neskodi)
#### Post date: [February 11, 2022, 9:21am UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932/1 "2022-02-11T09:21:27Z")

</div>

Hello,

please help us debug a strange error we come across in our iOS app while trying to mark a chat message as delivered.

This is the notification JSON payload we receive from Sendbird:

```auto
{
    "sendbird": {
        "app_id": "XXXXXXXXX-XXXX-XXXX-XXXX-7013FFD0F2C9",
        "audience_type": "only",
        "category": "messaging:offline_notification",
        "channel": {
            "channel_url": "sendbird_group_channel_136367504_88efab5fa76ed63a79d471723850b633aa7cd697",
            "custom_type": "team_chat",
            "name": "Company BD"
        },
        "channel_type": "chat",
        "created_at": 1644565493320,
        "custom_type": "",
        "files": [],
        "mentioned_users": [],
        "message": "Hello my friend! ",
        "message_id": 6779116511,
        "push_sound": "default",
        "push_title": "<null>",
        "recipient": {
            "id": 390,
            "name": "Worker 5005",
            "push_template": "default"
        },
        "sender": {
            "id": 278,
            "name": "Owner Of 5001",
            "profile_url": "https://good-work-public-dev-bucket-2.s3.us-east-1.amazonaws.com/users/353/Bz9fsE8cGAxpOFTkcTCNZX8XrEVd8QOmDwbetxSz.jpg",
            "require_auth_for_profile_image": 0
        },
        "sqs_ts": 1644565493479,
        "translations": {},
        "type": "MESG",
        "unread_message_count": 16
    },
    "aps": {
        "alert": "Owner Of 5001: Hello my friend! ",
        "badge": 16,
        "category": "sendbird_mesg",
        "mutable-content": 1,
        "sound": "default"
    }
}

```

According to the instructions in Sendbird docs, we are handling it with this code found at [Delivery receipt | Chat iOS SDK | Sendbird Docs](https://sendbird.com/docs/chat/v3/ios/tutorials/delivery-receipt)

```auto
SBDMain.markAsDelivered(withRemoteNotificationPayload: bestAttemptContent.userInfo) { (error) in
    guard error == nil else {
        // Handle error. 
        // We end up here because an error 800130 is raised.
    }
    ...
}

```

We end up in the error handling block with this error:

```auto
(Error Domain=Invalid payload Code=800130 "Invalid payload" UserInfo={NSLocalizedDescription=Invalid payload})

```

As you see there’s no useful information in the error message about what exactly is wrong in the payload. We assume it expects something else but we can’t figure out what exactly?

Please give us a hint at what we are doing wrong here?

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [February 11, 2022, 11:35am UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932/2 "2022-02-11T11:35:07Z")

</div>

Hello @Neskodi

Are you using FCM to send a push to iOS device? Because it looks like the payload doesnt contain session\_key which is required to process on iOS SDK

---

<div class="post-metadata">

### Author: ![Neskodi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/neskodi/32/2027_2.png) [@Neskodi](https://community.sendbird.com/u/Neskodi)
#### Post date: [February 11, 2022, 1:12pm UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932/3 "2022-02-11T13:12:47Z")

</div>

@Woo Thank you for the response! Indeed we don’t use FCM for notifications. We are using a p8 certificate instead. Is it possible to find this key/value elsewhere and inject into the payload manually?

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [February 11, 2022, 7:53pm UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932/4 "2022-02-11T19:53:40Z")

</div>

I dont think that would resolve the problem since session key is not visible to public. Would you DM me your app Id and will look into it. If this payload was from the sendbird server, its something off

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [February 11, 2022, 7:57pm UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932/5 "2022-02-11T19:57:22Z")

</div>

Oh btw did you receive this push payload while the device was on background or foreground?

---

<div class="post-metadata">

### Author: ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)
#### Post date: [February 11, 2022, 8:30pm UTC](https://community.sendbird.com/t/ios-chat-sdk-error-800130-while-trying-to-mark-message-as-delivered/3932/6 "2022-02-11T20:30:26Z")

</div>

or maybe your application does not turn on delivery receipt feature. Either way, DM me your application id and I will look into it! Thanks
