【发布时间】:2017-08-21 02:34:20
【问题描述】:
我正在尝试使用 getstream.io 的客户端功能 (特别是提要拉取和实时更新)在使用 react-native 构建的本机应用程序上构建流。当我尝试使用从我的服务器传递的令牌在 javascript 代码中初始化客户端时,我收到错误:
[Error: Missing app id, which is needed to subscribe, use var client = stream.connect(key, secret, appId);]
但是,当我添加秘密和 appId 时(出于测试目的,我会非常警惕这样的部署)我收到错误:
[Error: You are publicly sharing your private key. Dont use the private key while in the browser.]
有没有办法让客户端版本使用 Expo(Create React Native App 默认)运行而不从 Create React Native App 弹出?
【问题讨论】:
-
出于好奇,您将如何在不将密钥放入应用程序的情况下使用此本机应用程序? (顺便说一下,我们不推荐)
-
本机应用程序与 Rails 服务器通信以传递来自登录用户的令牌(使用流的 Ruby 客户端)并使用它初始化 feed 变量。
标签: node.js react-native getstream-io create-react-native-app