
ืฉืคื ๐ฎ๐ฑ ืขืืจืืช
ืชืืขืื
ืืชืืื
ืฉืืืืฉ
Add Comment Widgets to Your React Native App
ืื ืืกืคืจืืื ืืจืฉืืืช ืฉื React Native ืขืืืจ FastComments.
ืืืืขื ืืืืื'ืืื ืฉื ืชืืืืืช ืืืื ืืืช, ืฆ'ืื ืืืืงืืจืืช ืืืคืืืงืฆืืืช React Native ืฉืืื.
ืืืืจ
ืืืืื ืืื 
ืืื ืืจืืืช ืื ืืืืื'ื ืืื ืืจืืื ืฉืจืฆืื ืืืืคื ืืงืืื ืืื ืึพtenant ืืฆืืืืจื demo, ืฉืืืื ืืช ืืืืืจ ืืืจืืฆื:
yarn bootstrap
cd example
yarn ios # ืื: yarn android, yarn web
ื ืงืืืช ืืื ืืกื ืฉื ืชืฆืืืช ืืืืืื ืืื example/src/ShowcaseApp.tsx โ ืืคืืืงืฆืื ืืืช ืฉืืฆืืื ืืช ืื ืืืืืื'ืืื, ืขืจืืืช ืื ืืฉื ืืืืจืืืืช.
ืืืขื yarn web ืืฉืชืืฉ ืึพreact-native-web + react-native-web-webview (ืฉืืฆืื ืืช ืึพWebView ืึพiframe). ืฉืืืืฉื ืืืืืงืืช ืืืืชืืืช ืืืืจืืช ืืืคืืคื; ืืืฉืงื ืึพWebView ืืืืืขืืื ืื ืืืืื ืืืื ืืื injectJavaScript ืึพonShouldStartLoadWithRequest ืื ืืชืคืงืื ืืืืืื ืืืจืกืช ืึพweb.
ืฉืงืื ืืช ื-SDK ืื ืืืืื 
ืกืคืจืืื ืื ืืฉืชืืฉืช ื-webview ืฉืืงืืฃ ืืช ืกืคืจืืืช VanillaJS.
FastComments ืืขืช ืชืืืืช ืืืืืืฉ ืืงืืื ืืื ืฉื ืืืงืื ืฉืื ื ืืืืง ื-fastcomments-react-native-sdk.
ืื ืืจืฆืื ื ืืืืืืฉ ืืงืืื ืืื, ืืืื ืืืืืง ืฉื.
ืฉืืืืฉ - ืืืืื'ื ืชืืืืืช ืืืื ืืืช 
ืืืฉืง ื-API ืฉืื ื ืืืขื ืืืฉืืืื ื-fastcomments-react. ื-native, ืื ื ืืขืืืจืื ืืืืืืงื config ืฉืขืืงื ืืืจื ืืืื ื ืืื.
import { FastCommentsCommentWidget } from 'fastcomments-react-native';
// ...
const myTenantId = 'demo'; // ืืืื ื-tenant ืฉืื. ื ืืชื ืืืืืจ ืืืชื ื-https://fastcomments.com/auth/my-account/api-secret
const myAppPageId = 'native-test'; // ืืืื ืื ืืชืืืช URL ืฉื ืฉืจืฉืืจ ืืชืืืืืช ืืืคืืืงืฆืื ืฉืื.
const myAppPageUrl = 'https://example.com/external-page'; // ืืืคืฉืจืืชื ืืืืืจ ืืืืืืจ ืืชืืืช URL ืืขืืื ืืืฆืื ื
const myAppPageTitle = 'Example Title'; // ... ืืืืื ืื ืื ืจืื ืชืจืฆื ืืืชืจืช ืืชืืื ืื
const [config, setConfig] = useState({
tenantId: myTenantId,
urlId: myAppPageId,
url: myAppPageUrl,
pageTitle: myAppPageTitle
});
// ืขื-ืืื ืงืจืืื ื-setConfig() ืื ืื ื ืืืืืื ืืืฆืข ืคืขืืืืช ืืื ืฉืื ืื ืืืฃ ืื ืืืื, ืื ืืืฉืชืืฉ ืืืืืืจ ืืขืช
// ืจืื example/src/App.tsx
return (
<FastCommentsCommentWidget config={config}/>
);
ืฉืืืืฉ - ืืืืื'ื ืฆ'ืื ืืืื ืืืช 
import { FastCommentsLiveChatWidget } from 'fastcomments-react-native';
// ...
const myTenantId = 'demo'; // ืืืื ืืฉืืืจ ืฉืื. ื ืืชื ืืืฉืื ืืืชื ื https://fastcomments.com/auth/my-account/api-secret
const myAppPageId = 'native-test'; // ื-ID ืื ื-URL ืฉื ืฉืจืฉืืจ ืืชืืืืืช ืืืคืืืงืฆืื ืฉืื.
const myAppPageUrl = 'https://example.com/external-page'; // ื ืืชื ืืืืคื ืืืคืฆืืื ืื ืืืืืืจ URL ืืืฃ ืืืฆืื ื
const myAppPageTitle = 'Example Title'; // ... ืืืืื ืชืจืฆื ืืืชืจืช ืืชืืื ืื
const config = {
tenantId: myTenantId,
urlId: myAppPageId,
url: myAppPageUrl,
pageTitle: myAppPageTitle
};
return (
<FastCommentsLiveChatWidget config={config}/>
);
ืฉืืืืฉ - SSO (ืื ืืกื ืืืืื) 
FastComments ืืฉืชืืฉ ืึพHMAC ืขืืืจ SSO ืืืืืื. ืืื ืืืฉืชืืฉ, ืืงืฆื ืืฉืจืช ืฉืื ืฆืืจ ืืช ืืืืืืงื ืโSSO (ืชืืื ืช ืืชืฆืืจื sso) ืืฉืื ืืืชื
ืืืืืืื'ื ืืชืืืืืช.
ื ืืชื ืืืฆืื ืืืืืืืช ืขืืืจ ืืืืื backend-ืื, ืืื: https://github.com/FastComments/fastcomments-code-examples/tree/master/sso
ืชืืืืืช ืขืืืชืื 
fastcomments-react-native ืืืจืฉ ืืช react-native-webview. ืืื ืขืืื ืืขืงืื ืืืจื ืฉืืื ืืืชืงื ื ืฉื react-native-webview.
ืืืืจ ืืฉืืื (ืชืฉืืืช ืื: ืืงืืืืช ืืืืืืื ืืืืจืืคื)
ืื ืืืฉืืื ืฉืื ืืืืงื ืืืืืื ืืืืจืืคื, ืืืืจ region = 'eu' ืืชืฆืืจืช ืืืืืื'ื.
ืืืจืช, ืืื ื ืฆืจืื ืืืืืืจ ืืช region.
ืืฆื ืชืืืืงื 
ืืจืืืืื ืืื ืื ืขืืืคืืช ืกืืื ืจืืืื ื-VanillaJS ืืืจืืืืื ืฉืื ื. ืื ื ืืืืืื ืืขืืื ืืืืืืืืช ืืช ืืืจืืืืื ืืืื (ืืชืงื ืืืืื, ืืืืกืืฃ ืชืืื ืืช) ืืื ืคืจืกืื ืฉื ืกืคืจืื ืื, ืืื ืืืจืืช ืฉืืืชืื ืฉืื ืชืชืคืจืกื ืืชืงืืคื ืืกืืืืช โ ืื ืื ืืืืจ ืฉโFastComments ืืื ื ืืคืืชืื ืคืขืื! ืืชื ืืืืื ืื ืืืืืง ืืช ืืืืื ืฉืื ื ืืขืืืื ืื. ืฉืื ืืืื ืืืืชืืื ื-API ืื ืชืืื ืืช ืฉืืฉืืจื ืชืืืืืช ืื ืืฉืืืื ืืกืคืจืืืช ืืืืื ืืืกืืกืืช ืืืื ืืขืืืช ืืจืกื ืืกืคืจืื ืืื.
ืืงืืง ืืขืืจื?
ืืืืื ืื ืชืงืืชื ืืืขืืืช ืื ืืฉ ืืื ืฉืืืืช ืืืื ืกืคืจืืืช React Native, ืื ื:
ืชืจืืื
ืชืจืืืืช ืืชืงืืืืช ืืืจืื! ืืงืจื ืืืืืจ ื-GitHub ืืงืืืช ืื ืืืืช ืืชืจืืื.