-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create LibXMTP Client - android #231
Merged
Merged
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6df9da4
Added setup for testing against local xmtp-android
cameronvoell 4f8a793
Merge branch 'main' into cv/group-spike
cameronvoell eb11dee
Add missing SigningKey methods
cameronvoell d9378de
Added enableAlphaMls ClientOption
cameronvoell 1abdc53
Test passing for client creation
cameronvoell 483a479
lint Client.ts
cameronvoell cd4e28d
Add context to other create method, connected wallet groups button
cameronvoell 5366aa1
Merge branch 'main' into cv/group-spike
cameronvoell 01e69b9
only allow alpha mls when local
cameronvoell f89d4f5
Add group messaging
cameronvoell 03c4bec
Import xmtp android with MLS from maven
cameronvoell 70f5ff8
Merge branch 'main' into cv/group-spike
cameronvoell 2685b2d
lint fixes
cameronvoell 19e03d8
Adjusted function name listMemberAddresses
cameronvoell 573b2af
No need to call accountAddress on libXMTPClient
cameronvoell 43c35c7
Remove signLegacy method, update android to 0.7.9
cameronvoell a68fe27
feat: basic group chat
cameronvoell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
android/src/main/java/expo/modules/xmtpreactnativesdk/wrappers/GroupWrapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package expo.modules.xmtpreactnativesdk.wrappers | ||
|
||
import android.util.Base64 | ||
import android.util.Base64.NO_WRAP | ||
import com.google.gson.GsonBuilder | ||
import org.xmtp.android.library.Client | ||
import org.xmtp.android.library.Group | ||
|
||
class GroupWrapper { | ||
|
||
companion object { | ||
private fun encodeToObj(client: Client, group: Group, idString: String): Map<String, Any> { | ||
return mapOf( | ||
"clientAddress" to client.address, | ||
"id" to idString, | ||
"createdAt" to group.createdAt.time, | ||
"peerAddresses" to group.memberAddresses(), | ||
|
||
) | ||
} | ||
|
||
fun encode(client: Client, group: Group): String { | ||
val gson = GsonBuilder().create() | ||
val obj = encodeToObj(client, group, Base64.encodeToString(group.id, NO_WRAP)) | ||
return gson.toJson(obj) | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I wonder if this will work for sure worth trying but I almost think that would just give me the bytearray of the signature object
When I think we want something more like this
https://github.com/xmtp/xmtp-android/pull/156/files#diff-2be5e4bd7739dcb1debb7023943ee5544ebef6355405115cf89aa0e0a3ee09edR97-R102
Maybe this would do to get the bytes out of the signature 🤔