Skip to content
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

Getting Channel Metadata #1

Open
lathamios opened this issue Aug 21, 2020 · 0 comments
Open

Getting Channel Metadata #1

lathamios opened this issue Aug 21, 2020 · 0 comments

Comments

@lathamios
Copy link

lathamios commented Aug 21, 2020

Hi guys,

It's fantastic that you have put this together as I am also looking for a plugin to use Sendbird with flutter. I am an absolute newbie with both Kotlin and Swift and I have been trying to adapt your code to be able to extract groupchannel metadata, however all me attempts so far have failed. For example in the

/ios/Classes/SendBirdUtils.swift

file I have tried to include the following code in the extractChannel function to extract the channel metadata:

var channelMetadata = [String: String]() channel.getAllMetaData { (metaData, error) in guard let extraData = metaData, error == nil else { if let error = error { print("error retrieving metadata: \(error)") return } else { fatalError("error can't be nil") } } channelMetadata = extraData }

I then try to store the one of the keys as so:

js["status"] = channelMetadata["searchCity"]

I have included status in the Flutter channel class, but when I try to access it in flutter I get "null", even though I know it has a value for that channel. Do you have any tips?
Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant