diff --git a/android/build.gradle b/android/build.gradle index 943eb49b2..fa54a30a3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -88,7 +88,7 @@ repositories { dependencies { implementation project(':expo-modules-core') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}" - implementation "org.xmtp:android:0.5.1" + implementation "org.xmtp:android:0.5.3" implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.facebook.react:react-native:0.71.3' implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1" diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 2966a825f..f6c80209e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -415,7 +415,7 @@ PODS: - GenericJSON (~> 2.0) - Logging (~> 1.0.0) - secp256k1.swift (~> 0.1) - - XMTP (0.5.0-alpha0): + - XMTP (0.5.1-alpha0): - Connect-Swift - GzipSwift - web3.swift @@ -423,7 +423,7 @@ PODS: - XMTPReactNative (0.1.0): - ExpoModulesCore - MessagePacker - - XMTP (= 0.5.0-alpha0) + - XMTP (= 0.5.1-alpha0) - XMTPRust (0.3.1-beta0) - Yoga (1.14.0) @@ -680,8 +680,8 @@ SPEC CHECKSUMS: secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634 SwiftProtobuf: 7773c4e96a99d7b8ab7cda0fc30a883732ff93b1 web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 - XMTP: 83467dcc466ce1280662e928f03688d6b735e80d - XMTPReactNative: 2b53a695526c89cb3430968c5aae1cac6815aa49 + XMTP: 1f7a1daf482994871a920cb6fff4ee4ceeefae12 + XMTPReactNative: 7dd97d8bd98a7fc8e70e3511c4f75de116450379 XMTPRust: 78f65f77b1454392980da244961777aee955652f Yoga: 065f0b74dba4832d6e328238de46eb72c5de9556 diff --git a/example/src/tests.ts b/example/src/tests.ts index 277aba066..be9f64eb7 100644 --- a/example/src/tests.ts +++ b/example/src/tests.ts @@ -93,46 +93,56 @@ test("createFromKeyBundle throws error for non string value", async () => { }); test("can list batch messages", async () => { - try { - const bob = await XMTP.Client.createRandom({ env: "local" }); - await delayToPropogate(); - const alice = await XMTP.Client.createRandom({ env: "local" }); - await delayToPropogate(); - if (bob.address === alice.address) { - throw new Error("bob and alice should be different"); - } + const bob = await XMTP.Client.createRandom({ env: "local" }); + await delayToPropogate(); + const alice = await XMTP.Client.createRandom({ env: "local" }); + await delayToPropogate(); + if (bob.address === alice.address) { + throw new Error("bob and alice should be different"); + } - const bobConversation = await bob.conversations.newConversation( - alice.address - ); - await delayToPropogate(); + const bobConversation = await bob.conversations.newConversation( + alice.address + ); + await delayToPropogate(); - const aliceConversation = (await alice.conversations.list())[0]; - if (!aliceConversation) { - throw new Error("aliceConversation should exist"); - } + const aliceConversation = (await alice.conversations.list())[0]; + if (!aliceConversation) { + throw new Error("aliceConversation should exist"); + } - await bobConversation.send({ text: "Hello world" }); - await delayToPropogate(); - const messages: DecodedMessage[] = await alice.listBatchMessages([ - { - contentTopic: bobConversation.topic, - } as Query, - { - contentTopic: aliceConversation.topic, - } as Query, - ]); - - if (messages.length < 1) { - throw Error("No message"); - } + await bobConversation.send({ text: "Hello world" }); + const bobMessages = await bobConversation.messages(); + await bobConversation.send({ + reaction: { + reference: bobMessages[0].id, + action: "added", + schema: "unicode", + content: "💖", + }, + }); - const firstMessage = messages?.[0]; + const bobMessages2 = await bobConversation.messages(); - return firstMessage.content.text === "Hello world"; - } catch (e) { - return false; + await delayToPropogate(); + const messages: DecodedMessage[] = await alice.listBatchMessages([ + { + contentTopic: bobConversation.topic, + } as Query, + { + contentTopic: aliceConversation.topic, + } as Query, + ]); + + if (messages.length < 1) { + throw Error("No message"); + } + + if (messages[0].contentTypeId !== "xmtp.org/reaction:1.0") { + throw Error("Unexpected message content " + messages[0].content); } + + return true; }); test("can paginate batch messages", async () => { diff --git a/ios/XMTPReactNative.podspec b/ios/XMTPReactNative.podspec index ebdd070e6..1731c0178 100644 --- a/ios/XMTPReactNative.podspec +++ b/ios/XMTPReactNative.podspec @@ -25,5 +25,5 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,swift}" s.dependency "MessagePacker" - s.dependency "XMTP", "= 0.5.0-alpha0" + s.dependency "XMTP", "= 0.5.1-alpha0" end