Skip to content

Commit

Permalink
Merge pull request #634 from xmtp/serialize
Browse files Browse the repository at this point in the history
Serialize & Deserialized
  • Loading branch information
humanagent authored Feb 7, 2024
2 parents 66ddfe9 + 4fdfc04 commit ca16ddb
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions docs/build/conversations.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,40 +362,7 @@ val conversations = JSON.parse(loadConversationsFromSomewhere())
val client.importConversation(conversations)
```

</TabItem>
<TabItem value="swift" label="Swift" attributes={{className: "swift_tab"}}>

Code sample coming soon

</TabItem>
<TabItem value="dart" label="Dart" attributes={{className: "dart_tab"}}>

Code sample coming soon

</TabItem>
<TabItem value="rn" label="React Native" attributes={{className: "rn_tab"}}>

Code sample coming soon

</TabItem>
</Tabs>

## Serialize/Deserialize conversations

You can save a conversation object locally using its `encodedContainer` property. This returns a `ConversationContainer` object which conforms to `Codable`.

<Tabs groupId="sdk-langs">
<TabItem value="js" label="JavaScript" attributes={{className: "js_tab"}}>

Not applicable

</TabItem>
<TabItem value="react" label="React" attributes={{className: "react_tab"}}>

Not applicable

</TabItem>
<TabItem value="kotlin" label="Kotlin" attributes={{className: "kotlin_tab"}}>
**Serialize/Deserialize conversations**: You can save a conversation object locally using its `encodedContainer` property. This returns a `ConversationContainer` object which conforms to `Codable`.

```kotlin
// Get a conversation
Expand All @@ -419,6 +386,8 @@ decodedConversation.send(text = "hi")
</TabItem>
<TabItem value="swift" label="Swift" attributes={{className: "swift_tab"}}>

**Serialize/Deserialize conversations**: You can save a conversation object locally using its `encodedContainer` property. This returns a `ConversationContainer` object which conforms to `Codable`.

```swift
// Get a conversation
let conversation = try await client.conversations.newConversation(
Expand Down

0 comments on commit ca16ddb

Please sign in to comment.