Skip to main content

encore_flutter 2.6.0 copy "encore_flutter: ^2.6.0" to clipboard
encore_flutter: ^2.6.0 copied to clipboard

Flutter plugin wrapping the native Encore iOS and Android SDKs for monetization, offers, and entitlements. All offer UI is rendered natively via StoreKit (iOS) and Play Billing (Android).

2.6.0 #

Requires native iOS EncoreKit 2.6.0 and Android com.encorekit:encore 2.6.0.

From the 2.6.0 native SDKs #

  • The reward sheet draws the skin set for your app on Encore's side (colours, corners, borders and images per component) while the skin is on for the app. With no skin, the sheet draws exactly as before.
  • Reward sheet motion: entrances, finite loops, moves between screens and Lottie files come from the served look, with no call. Lottie plays only when your app links it (lottie-ios 4.x on iOS, com.airbnb.android:lottie 5.2 or later on Android). Without it, the element draws as before.
  • Fix: a "Yes, I did it" alone no longer counts as a completion, so a gifts button or claim entry that hides or thanks after a completion waits until the claim is verified or granted.
  • Server behaviour, on any version: a user whose age you send (age or dateOfBirth) is under 13 gets no offers.

Sheet fonts #

Needs native iOS EncoreKit 2.6.0 and Android com.encorekit:encore 2.6.0.

  • New: Encore.placement(id).appearance(AppearanceConfig(...)) styles that presentation's reward sheet. It was missing from the Flutter builder.
  • New: AppearanceConfig.sheet, a SheetAppearance(headingFontFamily:, bodyFontFamily:). The heading font draws text the sheet's portal skin marks as heading (typically the title, subtitle and primary button); the body font draws the rest. Register the font natively too (iOS UIAppFonts, Android res/font); see the README. Blank names are dropped. On Android the name is looked up in res/font as given, then lowercased with every character outside [a-z0-9_] as _. A font that is in res/font but cannot load falls back to the system font. A trigger's appearance ignores sheet.
  • AppearanceConfig.toMap() now returns Map<String, Object> (it was Map<String, String>), to carry the nested sheet.

EncoreClaim.child: Encore shows or hides your own widget #

  • New: EncoreClaim.child(placement: 'streak', child: ...). It takes the options EncoreClaim takes and draws child only while the handle has offers (gifts, a reminder or a thanks), and SizedBox.shrink() otherwise, so it takes no space. A tap anywhere on it opens the reward sheet (the first tap the SDK handles itself; before, your widget called claim.tap()), and it reads as one button, named semanticsLabel when given (in place of the child's text). Use a child with no taps of its own: a button or InkWell inside wins the tap.
  • EncoreClaim(builder: ...) is unchanged. Use it to draw each state yourself.

2.5.0 #

Requires native iOS EncoreKit 2.5.0 and Android com.encorekit:encore 2.5.0.

Sheet text #

  • sheetHeadline and sheetSubheadline on EncoreTrigger, EncoreGiftsButton and EncoreClaimReminder set the headline and subheadline of the sheet a tap (or the automatic open) opens. They are separate from headline and subheadline, which still style the look only. The text goes to the native SDK as given and gets the same cleaning as headline; null or blank, the sheet shows its own text, as before. A change updates the mounted trigger for the next sheet.
  • The same sheetHeadline and sheetSubheadline on EncoreClaim, sent when the handle is made and updated on the live handle when they change.

Reward for trying: a "Yes" no longer hides the offer #

  • A "Yes, I completed it" no longer hides the offer. Only a completion the brand confirms does, on every device. The list of "Yes" offers older builds kept on the device is cleared on upgrade.
  • An offer the user already said "Yes" to stops promising a prize: the first "Yes" per user per offer is still the only one that can earn it.
  • EncoreClaimedOffer.claimUrl: the attributable link the user opened for this claim, on both claimed and verified. It carries the user's transaction id, so treat it as user-specific and keep it out of third-party logs or analytics. null when there is no such link, such as for a demo offer, a lead form or a link that carries no transaction id. toString() prints <redacted> in its place, so a logged result never carries the link.

2.4.0 #

Requires native iOS EncoreKit 2.4.0 and Android com.encorekit:encore 2.4.0, the release that ships the trigger components and the claim handle.

Added #

  • EncoreTrigger(id:, placement:, useCase:, autoOpen:, icon:, alignment:, appearance:, headline:, subheadline:, cta:, values:, publisherReward:, onResult:) shows an inline Encore trigger drawn by the native SDK, embedded as a platform view. It fills the width it is given, takes the trigger's height while it shows and zero height when there is nothing to show (an id this native build does not ship, the churn use case, no content for this user, holdout, or an error), so it can sit in a list without a placeholder. Layout, analytics and taps run natively; there is nothing to handle in Dart. headline, subheadline and cta set the look's text in place of its own; null or blank, the look shows the text set for it on Encore's side, and a look with no spot for a slot keeps its own.
  • EncoreGiftsButton(placement:, useCase:, autoOpen:, icon:, alignment:, appearance:, headline:, subheadline:, cta:, values:, publisherReward:, onResult:): a button or card that opens the Encore sheet for useCase (default EncoreUseCase.rewardUsers) at that placement. Encore picks the look on its side. Whether it may open its sheet by itself (at most once per placement per day) is decided by Encore per served look; autoOpen: EncoreAutoOpen.off opts out, and off always wins. After a claim, or once a claimed offer completes, Encore may turn it into the claim reminder (with its ×), a thank-you look, or nothing, as the served look says.
  • EncoreClaimReminder(placement:, useCase:, icon:, alignment:, appearance:, headline:, subheadline:, cta:, values:, publisherReward:, onResult:): a banner for an offer the user claimed but has not finished. Tapping it opens the Encore sheet with that offer in it. Once the claimed offer completes, Encore may show its thank-you look instead. Encore picks the look on its side.
  • On every trigger: icon (EncoreTriggerIcon.gift, the default, appIcon or none); alignment (EncoreAlignment.center, the default, leading or trailing), where the look sits when the served look is narrower than the trigger, moved in place when it changes; values, your own words and numbers for the look to draw, updated in place when they change; optional publisherReward, which puts your own prize on the sheet it opens, as Encore.placement(id).publisherReward(...) does; and optional onResult, which gets the same result show() returns, once for every sheet the trigger opens, including one it opens by itself. What a trigger does after a claim is decided by Encore.
  • AppearanceConfig, a trigger's own brand colours, winning over your Encore portal's accent and the served look's colours: accentColor, backgroundColor, backgroundEndColor, textColor, secondaryTextColor, trackColor, onAccentColor and colorScheme (EncoreColorScheme.system, light or dark). In a trigger, textColor applies on its own. The sheet the trigger opens keeps its own look.
  • Build your own button: EncoreClaim(placement:, useCase:, autoOpen:, publisherReward:, onResult:, builder:) drives your own gifts button or claim reminder. builder gets an EncoreClaimState (EncoreClaimHiddenState, EncoreClaimGiftsState, EncoreClaimReminderState or EncoreClaimThanksState) and an EncoreClaimController whose tap() opens the reward sheet and returns the same result show() does. What it turns into after a claim and after a completed one, and whether the sheet may open by itself, are set per served look on Encore's side; autoOpen: EncoreAutoOpen.off opts out of the automatic open. If those rules cannot be fetched, it shows the reminder while a claim is open, then the gifts again. A second tap while one is in flight completes at once as not presented.
  • age on EncoreUserAttributes: the user's age in whole years, 0 to 120; the native SDK drops a value outside that range. If you only know a range, send its lowest age.
  • dateOfBirth on EncoreUserAttributes (YYYY-MM-DD) stays supported next to age: pass whichever you have. The native SDK works the age out on the device, in whole years, and never sends the date. Given both, the lower age is used. An unreadable or future date gives no age.

2.3.1 #

Ships with native iOS EncoreKit 2.3.1 and Android com.encorekit:encore 2.3.1.

Reward for trying: a reward on every offer, and pay on verification #

What changed

  • Each offer on the reward-for-trying sheet now shows its own reward, for example "500 coins". You set the amount in the Encore portal under your app's reward settings, and can override it per offer on the Offers page. An offer with no amount shows your publisher reward title, as before.
  • New "pay on verification" mode. When your app's reward settings use it, a user's "Yes" no longer grants the reward. The reward is paid only when the advertiser confirms the completion, and an offer with no amount shows no reward.
  • The offer_completed webhook now includes a reward object with the amount and unit fixed when the user claimed the offer. Every webhook for the same transaction carries the same reward, so credit the user once per transactionId.

What to call

  • Nothing new. Identify the user with Encore.shared.identify(userId: userId) and pass your reward with Encore.placement(id).publisherReward(EncorePublisherReward(id: ..., title: ...)) when you show the placement, as in 2.3.0. The SDK reads the per-offer amounts and the mode from the server.

Requirements

  • Credit each reward from either the device or the offer_completed webhook, never both. In the default mode, grant on userConfirmedCompletion as in 2.3.0. If your app pays only on verification, set up the offer_completed webhook in the Encore portal and credit reward.amount from it.
  • Leave your app's reward settings unset until your users are on 2.3.1. Older SDKs show the flat reward title and their claims carry no reward on the webhook, so under pay on verification a user on an older build is never paid.

2.3.0 #

Ships with native iOS EncoreKit 2.3.0 and Android com.encorekit:encore 2.3.0.

Added #

  • Reward for trying. Pass your own prize on a placement with Encore.placement(id).publisherReward(EncorePublisherReward(...)). On a reward-for-trying variant the sheet promises it and, when the user comes back from the advertiser, asks whether they finished. Encore's server decides the prize per identified user, across devices, so identify() is required: an anonymous user gets no promise. When the server grants a "Yes", the new EncoreClaimedOffer.userConfirmedCompletion is true on the show() result, and that is when your app grants the prize (from the result only, not also from outcomes, deduped on your user id plus campaignId). It is the user's own word: the advertiser stage and Encore's payout are unchanged. Passing a prize commits your app to paying it when the flag is true.
  • Encore.shared.setPublisherRewardPolicy(EncorePublisherRewardPolicy(...)) sets the daily limit on the prize (default 3 per user in any 24 hours; the native SDK clamps it to 1 to 10). The first "Yes" per user per offer earns the prize, and the server then hides that offer from the user.
  • EncoreClaimedOffer.userConfirmedCompletion defaults to false, so code that builds an EncoreClaimedOffer itself keeps compiling.
  • Encore.shared.setLanguage(tag) shows Encore's copy in an app-chosen language instead of the device language, for an in-app language picker. It takes a BCP 47 tag (fr, pt-BR), and only the language part is used. The choice is a device preference: it stays across launches and through reset() (logout) until clearLanguage(). For a tag that is not well-formed (for example pt_BR, from Locale.toString()), the returned future fails with an ArgumentError before anything reaches the native SDK.
  • Encore.shared.clearLanguage() removes that language so Encore's copy follows the device language again, for a picker that goes back to "System default". The user and every attribute are kept.
  • Encore.shared.configure accepts transactionLinking (default true). Set it to false to stop the store purchase query and the transaction uploads on both platforms.

Changed #

  • Deprecated: EncoreUserAttributes.language. It still works, applied natively as setLanguage would, and is removed in the next major version. Replace EncoreUserAttributes(language: tag) with Encore.shared.setLanguage(tag).
  • The SDK sends the device language with every request (Android from 2.3.0).

2.2.0 #

Add more UI variants for A/B testing Bug Fixes

2.0.1 #

Bug Fixes

2.0.0 #

Migrates the plugin onto the native Encore 2.0 surface (iOS EncoreKit 2.0.0, Android com.encorekit:encore 2.0.1). Breaking, with no compatibility shim; see "Migrating from 1.x" in the README for the full walkthrough.

Android 2.0.0 is not usable and must not be pinned: its published AAR shipped the 2.0 public API obfuscated, so nothing could compile against it. 2.0.1 is the first Android release that exposes the surface this plugin needs.

Breaking #

  • onPurchaseRequest and onPurchaseRequestResult are gone. Both native SDKs deleted onPurchaseRequest in 2.0 and replaced it with a registered purchase controller. Implement EncorePurchaseController and pass the instance to Encore.shared.configure(purchaseController: ...). The controller returns a three-valued EncorePurchaseResult (purchased / cancelled / pending) instead of nothing (1.x onPurchaseRequest, which could not report success at all) or a bool (1.x onPurchaseRequestResult, which reported deferred purchases — Ask to Buy, SCA — as failures).
  • onPurchaseComplete is gone, along with EncoreBillingPurchaseResult. The SDK no longer runs purchases itself, so there is no native purchase to report; your controller already sees every purchase it runs.
  • onPassthrough is gone. The presentation record answers the same question with more detail: EncoreNotPresented means nothing was shown, and a presented record carries the dismissal reason and both funnels.
  • EncorePresentationResult has a new shape. Granted / Claimed / NotGranted are replaced by EncoreNotPresented(reason) and EncorePresented(outcome), where the outcome carries two independent funnels — advertiser (the Encore offer claim) and publisher (your purchase) — plus a dismissal. The record is facts only: there is no SDK-computed "unlocked" verdict, because what a claim means is a property of the variant flow that served it.
  • Encore.shared.placements.setClaimEnabled(...) moved to Encore.shared.setClaimEnabled(...), matching the native SDKs, which folded the 1.x placements manager into the facade. EncorePlacements is removed.

Added #

  • Encore.shared.outcomes — a broadcast Stream<EncorePlacementOutcome> over the native outcomes stream. Carries every show() resolution plus EncoreStrictUnlockVerified events, which can land on a later launch than the presentation that produced them and so can never be a show() return value.
  • EncoreUnlockMode on configure, selecting how claims are verified. EncoreUnlockMode.strict is what makes EncoreStrictUnlockVerified reachable.
  • EncorePurchaseRequest.basePlanId — the Google Play base plan to select, when the product exposes several. null on iOS.
  • EncoreClaimedOffer carries campaignId, advertiserName and the transactionId that joins a claim to its later verification.

Fixed #

  • EncoreUseCase now actually reaches the native SDK. In 1.x the value was dropped at the bridge — neither native plugin implemented the channel method that carried it — so EncoreUseCase.rewardUsers could never present, and headline / subheadline overrides were silently ignored. Both bridges now forward all three on every show().

1.0.39 #

1
likes
130
points
960
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter plugin wrapping the native Encore iOS and Android SDKs for monetization, offers, and entitlements. All offer UI is rendered natively via StoreKit (iOS) and Play Billing (Android).

Homepage
Repository (GitHub)
View/report issues

Topics

#monetization #in-app-purchase #subscriptions #offers

License

unknown (license)

Dependencies

flutter

More

Packages that depend on encore_flutter

Packages that implement encore_flutter