Skip to content

Commit b0f31a5

Browse files
committed
update android + ios to fix api client cache
1 parent a6fad88 commit b0f31a5

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ repositories {
9898
dependencies {
9999
implementation project(':expo-modules-core')
100100
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
101-
implementation "org.xmtp:android:4.6.0-dev.5b616c7"
101+
implementation "org.xmtp:android:4.6.0-dev.c78f91f"
102102
implementation 'com.google.code.gson:gson:2.10.1'
103103
implementation 'com.facebook.react:react-native:0.71.3'
104104
implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1"

example/ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,16 +1736,16 @@ PODS:
17361736
- SQLCipher/standard (4.5.7):
17371737
- SQLCipher/common
17381738
- SwiftProtobuf (1.28.2)
1739-
- XMTP (4.6.0-dev.a9a72cf):
1739+
- XMTP (4.6.0-dev.4a8ee5d):
17401740
- Connect-Swift (= 1.0.0)
17411741
- CryptoSwift (= 1.8.3)
17421742
- SQLCipher (= 4.5.7)
1743-
- XMTPReactNative (5.0.5):
1743+
- XMTPReactNative (5.1.0-dev):
17441744
- CSecp256k1 (~> 0.2)
17451745
- ExpoModulesCore
17461746
- MessagePacker
17471747
- SQLCipher (= 4.5.7)
1748-
- XMTP (= 4.6.0-dev.a9a72cf)
1748+
- XMTP (= 4.6.0-dev.4a8ee5d)
17491749
- Yoga (0.0.0)
17501750

17511751
DEPENDENCIES:
@@ -2155,8 +2155,8 @@ SPEC CHECKSUMS:
21552155
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
21562156
SQLCipher: 5e6bfb47323635c8b657b1b27d25c5f1baf63bf5
21572157
SwiftProtobuf: 4dbaffec76a39a8dc5da23b40af1a5dc01a4c02d
2158-
XMTP: cac948151ff5a94810e392e66540bd5dbaf515ee
2159-
XMTPReactNative: 7619ec9b755ec19d37c8dc8beddf8b0b51abbfe0
2158+
XMTP: a0ec6e29b9a643198103eff675e098635c146ebe
2159+
XMTPReactNative: 7b8f2bdd675e885e46b8a17d5a14e22fb5a87832
21602160
Yoga: feb4910aba9742cfedc059e2b2902e22ffe9954a
21612161

21622162
PODFILE CHECKSUM: 283c313cbc1ba9857a692b5901eb740dad922eca

example/src/tests/clientTests.ts

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ethers, Wallet } from 'ethers'
22
import RNFS from 'react-native-fs'
33
import { ArchiveOptions } from 'xmtp-react-native-sdk/lib/ArchiveOptions'
44
import { InstallationId } from 'xmtp-react-native-sdk/lib/Client'
5-
5+
import { XMTPEnvironment } from 'xmtp-react-native-sdk/lib/Client'
66
import {
77
Test,
88
assert,
@@ -308,6 +308,49 @@ test('can make a client', async () => {
308308
return true
309309
})
310310

311+
// https://payer.testnet-staging.xmtp.network:443
312+
test('can make a new client and build existing from existing db using d14n staging testnet', async () => {
313+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
314+
const keyBytes = new Uint8Array([
315+
233, 120, 198, 96, 154, 65, 132, 17, 132, 96, 250, 40, 103, 35, 125, 64,
316+
166, 83, 208, 224, 254, 44, 205, 227, 175, 49, 234, 129, 74, 252, 135, 145,
317+
])
318+
const dbDirPath = `${RNFS.DocumentDirectoryPath}/xmtp_db`
319+
const directoryExists = await RNFS.exists(dbDirPath)
320+
if (!directoryExists) {
321+
await RNFS.mkdir(dbDirPath)
322+
}
323+
const options = {
324+
env: 'dev' as XMTPEnvironment,
325+
dbEncryptionKey: keyBytes,
326+
dbDirectory: dbDirPath,
327+
deviceSyncEnabled: false,
328+
appVersion: '0.0.0',
329+
gatewayUrl: 'https://payer.testnet-staging.xmtp.network:443'
330+
}
331+
332+
const client = await Client.createRandom(options)
333+
334+
const inboxId = await Client.getOrCreateInboxId(
335+
client.publicIdentity,
336+
'dev'
337+
)
338+
339+
assert(
340+
client.inboxId === inboxId,
341+
`inboxIds should match but were ${client.inboxId} and ${inboxId}`
342+
)
343+
344+
const clientFromBundle = await Client.build(client.publicIdentity, options)
345+
346+
assert(
347+
clientFromBundle.inboxId === client.inboxId,
348+
`inboxIds should match but were ${clientFromBundle.inboxId} and ${client.inboxId}`
349+
)
350+
351+
return true
352+
})
353+
311354
test('static can message', async () => {
312355
const [alix, bo] = await createClients(2)
313356

ios/XMTPReactNative.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
2626
s.source_files = "**/*.{h,m,swift}"
2727

2828
s.dependency "MessagePacker"
29-
s.dependency "XMTP", "= 4.6.0-dev.a9a72cf"
29+
s.dependency "XMTP", "= 4.6.0-dev.4a8ee5d"
3030
s.dependency 'CSecp256k1', '~> 0.2'
3131
s.dependency "SQLCipher", "= 4.5.7"
3232
end

0 commit comments

Comments
 (0)