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

When passing attributes on iOS and MacOS will cause value to cover to Optional() string #24

Closed
FelixYew opened this issue Aug 21, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@FelixYew
Copy link

First of all, thanks for the great package.
All the value pass through the attributes will convert to Optional string.
To fix this you may change the code for both iOS and MacOS on :

SwiftBonsoirPlugin.swift
From :
for (key, value) in attributes {
if (value != nil) {
result[key] = String(describing: value).data(using: .utf8)
}
}

To:
for (key, value) in attributes {
if let value = value {
result[key] = value.data(using: .utf8)
}
}

SuccessObject.swift
From :
for (key, value) in attributes {
if(value != nil) {
result[key] = String(decoding: value!, as: UTF8.self)
}
}

To :
for (key, value) in attributes {
if let value = value {
result[key] = String(decoding: value, as: UTF8.self)
}
}

@FelixYew FelixYew added the bug Something isn't working label Aug 21, 2021
@Skyost
Copy link
Owner

Skyost commented Aug 24, 2021

I think this was fixed in #25.

@Skyost Skyost closed this as completed Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants