【发布时间】:2019-08-05 16:14:17
【问题描述】:
当尝试使用 getstream 中的 addactivity() 时,它会返回 403。我正在使用的代码在这里。
let client = stream.connect(apiKey, getTokenFromServer(),appId);
let user = client.feed('user','x');
let activity = {'actor': 'x', 'verb': 'tweet', 'object': 1, 'foreign_id': 'tweet:1'};
user.addActivity(activity).then((data) =>{console.log('success')}).catch((reason) =>{alert(reason) });
查看来自 getstream.io 仪表板的日志,我看到“请求没有正确的权限或授权。请查看我们的文档以了解如何签署请求。'
目前使用令牌和相同的用户和提要,我可以使用 react-native 组件发布到提要。这对用户来说非常好,下面是一个 sn-p。
<StreamApp
apiKey=key
appId=id
token={token}>
<FlatFeed Activity={this.CustomActivity} notify={true} feedGroup={this.props.feed} userId={this.props.userId} />
<StatusUpdateForm userId={x} feedGroup="user" />
</StreamApp>
【问题讨论】:
标签: javascript react-native getstream-io