Twilio : Not able to set channel attribute

梦想与她 提交于 2019-12-11 16:55:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!