FastComments.com

Add Comment Widgets to Your React Native App

这是 FastComments 的官方 React Native 库。

在你的 React Native 应用中嵌入实时评论、聊天和点评小部件。

仓库

在 GitHub 上查看


实时演示 Internal Link

要查看针对公共 demo 租户在本地运行的每个小部件和流程,请克隆仓库并运行:

yarn bootstrap
cd example
yarn ios       # 或:yarn android, yarn web

The showcase entry point is example/src/ShowcaseApp.tsx — a single app that exposes all widgets, themes, and flows.

The yarn web target uses react-native-web + react-native-web-webview (which renders the WebView as an iframe). Useful for quick visual smoke tests in a browser; native-only WebView APIs like injectJavaScript and onShouldStartLoadWithRequest won't fully behave on web.

安装 Internal Link

npm

npm install react-native-webview --save
npm install fastcomments-react-native --save

考虑使用原生 SDK Internal Link

此库在 VanillaJS 库外层使用了一个 webview。

FastComments 现在在 fastcomments-react-native-sdk 中支持我们客户端的完全原生实现。 如果您想要完全的原生实现,建议查看该项目。

使用 - 单点登录 (SSO) Internal Link

FastComments 使用 HMAC 来实现安全的 SSO。 要使用,请让你的后端创建 SSO 对象 (sso 配置属性) 并将其传递给评论小部件。 你可以在这里找到各种后端的示例: https://github.com/FastComments/fastcomments-code-examples/tree/master/sso

对等依赖 Internal Link


fastcomments-react-native 依赖 react-native-webview。因此,你应当遵循 react-native-webview 的安装步骤。

账户区域(注意:欧盟客户)

如果你的账户位于欧盟,请在小部件配置中将 region = 'eu' 设置。

否则,你无需定义 region

维护状态 Internal Link

这些组件是围绕我们核心 VanillaJS 组件的包装器。我们可以自动更新这些组件(修复错误、添加功能),而无需发布此库,因此即便它可能一段时间不会发布,这并不意味着 FastComments 没有在积极开发!欢迎查看我们的博客以获取更新。除非同时提升本库的版本号,否则破坏性 API 更改或新功能绝不会被推送到底层核心库。

需要帮助?

如果在使用 React Native 库时遇到任何问题或有疑问,请:

贡献

欢迎贡献!有关贡献指南,请访问 GitHub 仓库