encore_flutter 2.3.0
encore_flutter: ^2.3.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.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, soidentify()is required: an anonymous user gets no promise. When the server grants a "Yes", the newEncoreClaimedOffer.userConfirmedCompletionis true on theshow()result, and that is when your app grants the prize (from the result only, not also fromoutcomes, deduped on your user id pluscampaignId). 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.userConfirmedCompletiondefaults tofalse, so code that builds anEncoreClaimedOfferitself 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 throughreset()(logout) untilclearLanguage(). For a tag that is not well-formed (for examplept_BR, fromLocale.toString()), the returned future fails with anArgumentErrorbefore 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.configureacceptstransactionLinking(defaulttrue). Set it tofalseto stop the store purchase query and the transaction uploads on both platforms.
Changed #
- Deprecated:
EncoreUserAttributes.language. It still works, applied natively assetLanguagewould, and is removed in the next major version. ReplaceEncoreUserAttributes(language: tag)withEncore.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 #
onPurchaseRequestandonPurchaseRequestResultare gone. Both native SDKs deletedonPurchaseRequestin 2.0 and replaced it with a registered purchase controller. ImplementEncorePurchaseControllerand pass the instance toEncore.shared.configure(purchaseController: ...). The controller returns a three-valuedEncorePurchaseResult(purchased/cancelled/pending) instead of nothing (1.xonPurchaseRequest, which could not report success at all) or abool(1.xonPurchaseRequestResult, which reported deferred purchases — Ask to Buy, SCA — as failures).onPurchaseCompleteis gone, along withEncoreBillingPurchaseResult. The SDK no longer runs purchases itself, so there is no native purchase to report; your controller already sees every purchase it runs.onPassthroughis gone. The presentation record answers the same question with more detail:EncoreNotPresentedmeans nothing was shown, and a presented record carries the dismissal reason and both funnels.EncorePresentationResulthas a new shape.Granted/Claimed/NotGrantedare replaced byEncoreNotPresented(reason)andEncorePresented(outcome), where the outcome carries two independent funnels —advertiser(the Encore offer claim) andpublisher(your purchase) — plus adismissal. 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 toEncore.shared.setClaimEnabled(...), matching the native SDKs, which folded the 1.x placements manager into the facade.EncorePlacementsis removed.
Added #
Encore.shared.outcomes— a broadcastStream<EncorePlacementOutcome>over the native outcomes stream. Carries everyshow()resolution plusEncoreStrictUnlockVerifiedevents, which can land on a later launch than the presentation that produced them and so can never be ashow()return value.EncoreUnlockModeonconfigure, selecting how claims are verified.EncoreUnlockMode.strictis what makesEncoreStrictUnlockVerifiedreachable.EncorePurchaseRequest.basePlanId— the Google Play base plan to select, when the product exposes several.nullon iOS.EncoreClaimedOffercarriescampaignId,advertiserNameand thetransactionIdthat joins a claim to its later verification.
Fixed #
EncoreUseCasenow 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 — soEncoreUseCase.rewardUserscould never present, andheadline/subheadlineoverrides were silently ignored. Both bridges now forward all three on everyshow().