
Lingua 🇮🇹 Italiano
Primi passi
Documentazione
Utilizzo
FastComments React Native Library
Questa è la libreria ufficiale React Native per FastComments.
Widget di commento FastComments per React Native
Repository
Installazione 
npm install react-native-webview@13.6.4 --save
npm install fastcomments-react-native --save
Nota: A partire da luglio 2024 sembra che react-native-webview abbia un bug, quindi è meglio fissare la versione a 13.6.4 - non usare ^ per ottenere l'ultima versione patch.
Considera l'SDK nativo 
Questa libreria usa una webview attorno alla libreria VanillaJS.
FastComments ora supporta un'implementazione completamente nativa del nostro client come parte di fastcomments-react-native-sdk. Se desideri un'implementazione completamente nativa, potresti voler dare un'occhiata lì.
Utilizzo - Widget commenti in tempo reale 
L'API è leggermente diversa rispetto a fastcomments-react. Con la versione nativa, passiamo un oggetto config che segue questa struttura.
import { FastCommentsCommentWidget } from 'fastcomments-react-native';
// ...
const myTenantId = 'demo'; // Il tuo tenant id. Può essere recuperato da https://fastcomments.com/auth/my-account/api-secret
const myAppPageId = 'native-test'; // L'ID o l'URL del thread di commenti nella tua app.
const myAppPageUrl = 'https://example.com/external-page'; // puoi opzionalmente impostare un URL per una pagina esterna
const myAppPageTitle = 'Example Title'; // ... e probabilmente vorrai un titolo per questo contenuto
const [config, setConfig] = useState({
tenantId: myTenantId,
urlId: myAppPageId,
url: myAppPageUrl,
pageTitle: myAppPageTitle
});
// chiamando setConfig(), possiamo fare cose come cambiare la pagina corrente o l'utente attualmente connesso
// Vedi example/src/App.tsx
return (
<FastCommentsCommentWidget config={config}/>
);
Utilizzo - Widget chat in tempo reale 
import { FastCommentsLiveChatWidget } from 'fastcomments-react-native';
// ...
const myTenantId = 'demo'; // Il tuo tenant id. Può essere recuperato da https://fastcomments.com/auth/my-account/api-secret
const myAppPageId = 'native-test'; // l'ID o l'URL del thread di commenti nella tua app.
const myAppPageUrl = 'https://example.com/external-page'; // puoi opzionalmente impostare un URL verso una pagina esterna
const myAppPageTitle = 'Example Title'; // ... e probabilmente vorrai un titolo per questo contenuto
const config = {
tenantId: myTenantId,
urlId: myAppPageId,
url: myAppPageUrl,
pageTitle: myAppPageTitle
};
return (
<FastCommentsLiveChatWidget config={config}/>
);
Utilizzo - SSO 
FastComments utilizza HMAC per SSO sicuro. Per usarlo, fai sì che il tuo backend crei l'oggetto SSO (proprietà di configurazione sso) e lo passi
al widget dei commenti.
Puoi trovare esempi per vari backend, qui: https://github.com/FastComments/fastcomments-code-examples/tree/master/sso
Dipendenze peer 
fastcomments-react-native richiede react-native-webview. Di conseguenza, dovresti seguire i passaggi di installazione per react-native-webview.
Account Region (ATTENZIONE: Clienti UE)
Se il tuo account si trova nell'UE, imposta region = 'eu' nella configurazione del widget.
Altrimenti, non è necessario definire region.
Hai bisogno di aiuto?
Se riscontri problemi o hai domande sulla libreria React Native, per favore:
Contribuire
I contributi sono benvenuti! Visita il repository GitHub per le linee guida sui contributi.