问题
I am using twilio chat sdk in my iPhone application, on twilio website I have settled role permission editChannelAttributes is true for creator. and trying to set attribute like
TwilioChatHelper.sharedInstance.selectedChannel?.setAttributes(attr, completion: { (result) in
print(result?.isSuccessful() ?? "Not able to set attributes")
})
but getting error in result
The operation couldn’t be completed. (signal.sdk.domain.error error 102.)
Please suggest me what I am missing.
回答1:
Twilio developer evangelist here.
Mahipal Singh is definitely on the right track here, this is down to roles and permissions in Twilio Chat.
A regular channel user role, by default, has the following permissions:
deleteOwnMessage
editOwnMessage
editOwnMessageAttributes
leaveChannel
sendMediaMessage
sendMessage
If you want all channel users to be able to update a channel's attributes, then you will need to use the Roles REST API to either add the editChannelAttributes
permission to the default channel role or create a new role with that permission that you then assign to your channel members.
Let me know if that helps at all.
来源:https://stackoverflow.com/questions/48181384/twilio-not-able-to-set-channel-attribute