Développeurs
Capacitor : démarrage rapide
Les étapes d'installation et de première utilisation pour envoyer des événements à Feralin avec Capacitor. Les exemples de code viennent du README du SDK et les statuts du registre des capacités.
Installation
Aucun paquet n’est encore publié sur npm. Le paquet est téléchargé depuis feralin.com ; les commandes vérifient d’abord l’empreinte SHA-256 de feralin-capacitor-0.1.0.tar.gz et s’arrêtent si la vérification échoue.
mkdir -p feralin-sdk
curl -fsSL https://feralin.com/sdk/packages/feralin-capacitor-0.1.0.tar.gz -o feralin-sdk/feralin-capacitor-0.1.0.tar.gz
echo "49a75170af21865b7af6cdf11ca63fa98a33dabf66f4c8b0ff9cb32c1ba231b4 feralin-sdk/feralin-capacitor-0.1.0.tar.gz" | sha256sum -c -
tar -xzf feralin-sdk/feralin-capacitor-0.1.0.tar.gz -C feralin-sdk
(cd feralin-sdk/feralin-capacitor-0.1.0 && npm install --no-save @capacitor/core@8 @feralin/web@0.1.0 typescript@5.9.3 && npx tsc -p tsconfig.json && npm pack --ignore-scripts)
npm install ./feralin-sdk/feralin-capacitor-0.1.0/feralin-capacitor-0.1.0.tgz
npx cap syncPremière utilisation
import { Feralin } from "@feralin/capacitor";
const ready = await Feralin.initialize({
projectKey: "pk_live_...", // yalnız public anahtar; sk_ reddedilir
collectUrl: "https://collect.example.com",
consent: savedConsent(), // CMP'nizin saklı kararı
attribution: { apiUrl: "https://api.example.com", projectId: "prj_..." }, // iOS ertelenmiş derin bağlantı için
});
await Feralin.trackFirstOpen(); // iOS: kurulum başına bir kez; Android: "automatic"; web: "not_supported"
await Feralin.track("level_up", { level: 3 });
await Feralin.trackRevenue({ transactionId: "order_1", amountMinor: 4999, currency: "TRY" });
const link = await Feralin.consumeDeferredDeepLink();
if (link.status === "delivered" && link.path) router.push(link.path); // yolu kendi tablonuzla eşleştirin
// Kaldırma ölçümü (push eklentinizden gelen belirteç ve ileti verisi)
await Feralin.setPushToken(token); // Android: FCM belirteci; iOS: APNs belirtecinin onaltılı yazımı
if (Feralin.isUninstallCheck(notification.data)) return;Les exemples de code sont repris tels quels de sdks/capacitor/README.md ; les commentaires peuvent y être en turc. La clé de projet se crée depuis la console.
Capacités
| Capacité | Statut |
|---|---|
| Envoi d'événements | Partiel |
| Envoi par lots | Partiel |
| Gestion du consentement | Partiel |
| Identité | Partiel |
| Attribution | Partiel |
| Liens profonds | Partiel |
| Revenus | Partiel |
| Capture des erreurs | Non pris en charge |
| Session replay | Sans objet |
| Traçage | Prévu |
Chaîne de vérification
| Maillon | Statut |
|---|---|
| Code source | Partiel |
| Compilation | Partiel |
| Tests | Réussi |
| Publication sur le registre | En attente d'un accès externe |
| Installation propre | Non exécuté |
| Réception de l'événement | Non exécuté |
| Documentation | Réussi |
| Preuve Super Admin | Non commencé |
Réussi signifie preuve locale : le code source, la compilation et les tests ont été exécutés. La publication sur le registre et la preuve Super Admin sont des maillons distincts ; tant que l'un n'est pas franchi, le SDK n'est pas considéré comme prêt.