influto 1.1.1
influto: ^1.1.1 copied to clipboard
Track influencer referrals, attribution, and store-direct purchase validation in your Flutter app. Mirrors the InfluTo React Native SDK.
Changelog #
1.1.1 #
Fixed #
setReferralCode()/applyCode()fall back to the user stored byidentifyUser()whenappUserIdisn't passed. Without it the backend rejected free-access codes withMISSING_USER_ID.setReferralCode()stores the code (and themanual_entryattribution record) and calls therevenueCatHookonly after the backend answerssuccess == true, using the canonical code it returns. A rejected code is no longer stored or tagged. Still fail-soft.ReferralCodeInput: the field no longer drops_(codes allow[A-Z0-9_-]), andonAppliedfires only when the code was actually applied (applied == true), not merely valid.
1.1.0 #
Fixed #
checkAttribution()no longer re-fires/sdk/track-installon every cold start for organic users: the organic (non-attributed) result is now persisted like the attributed one (contract 1.6.0). A failed request still retries on the next launch.
Added #
- Persisted per-install UUID (
@influto/install_id) sent asdevice_id, so the backend counts unique devices instead of launches. No permissions, no fingerprinting; resets on reinstall by design. - Deterministic
eventIdfor once-only monetization events (trial_started,subscription_purchased,subscription_renewed) derived from (event type, user, properties) — cross-launch re-fires collapse server-side.
1.0.0 #
Initial release of the InfluTo Flutter SDK.
Added #
- Full influencer attribution API:
initialize,checkAttribution,identifyUser,trackEvent,getActiveCampaigns,validateCode,setReferralCode,applyCode,getReferralCode,getPrefilledCode,clearAttribution— matching the canonical cross-platform contract (wire 1.0.0). - Store-direct purchase validation via
reportPurchase(StoreKit 2 JWS on iOS, Play purchase token on Android), posting to/sdk/purchase. Supports one-time / consumable products viaproductId/price/currency(NON_RENEWING validation). checkAccess— server-authoritative premium-access check powering platform-independent comp (free-access codes that grant entitlement without a purchase); works for both RevenueCat and store-direct apps. Positive results are cached in memory and persisted across cold starts (~5-min TTL).- Default-on automatic purchase capture for store-direct apps via the companion
influto_iappackage (InfluToPurchaseObserver) — listens toin_app_purchaseand auto-reports purchases; RevenueCat apps stay silent. Declare one-time SKUs viaoneTimeProductIds. Configurable throughInfluToConfig.autoCapture. - Optional RevenueCat integration through a host-supplied
revenueCatHookcallback — no hard dependency onpurchases_flutter. ReferralCodeInputwidget with live debounced validation;showCampaignNameandshowReferrerNameboth default tofalse(influencer name hidden unless explicitly opted in).- Pure Dart implementation — only
httpandshared_preferences. Fail-soft behavior on all methods exceptinitializeandreportPurchase.