我正在使用 GetStream Feeds 和 stream_feed_flutter_core 来构建类似 Instagram 的应用程序。我可以向提要添加活动,甚至可以上传文件,但无法上传图像。
我遵循的设置客户端和用户的步骤:
final client = StreamFeedClient("apiKey", logLevel: Level.INFO);
上传图片步骤:
流API响应:
{
"detail":"token contains an invalid number of segments",
"status_code":403,
"code":17,
"exception":"NotAllowedException",
"duration":"0.00ms",
"more_info":"https://getstream.io/docs/api_error_responses"
}
你能
setUser
吗?
你得到了什么context.feedClient
就我而言,它工作正常
this.client = connect(API_KEY, this.userToken, APP_ID)
async uploadImage (file) {
return new Promise((resolve, reject) =>
(async () => {
try {
const imgSrc = await this.client.images.upload(file)
resolve(imgSrc)
} catch (err) {
reject(err)
}
})()
)
}
const uploadImageSrc = async e => {
const image = e.target.files[0]
uploadImage(image)
}