Skip to content

feat(ads): reward-verification primitives for react-native#1828

Draft
peterporfy wants to merge 1 commit into
mainfrom
ads-296
Draft

feat(ads): reward-verification primitives for react-native#1828
peterporfy wants to merge 1 commit into
mainfrom
ads-296

Conversation

@peterporfy

@peterporfy peterporfy commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

DRAFT as it depends on open purchases-ios, purchases-android and purchases-hybrid-common changes.

Exposes the rewarded ad verification primitives so it can be used with unsupported react-native admob libraries.

Still need to test e2e once the new sdks are released - but the API usage will look something like:

  import { RewardedAd, RewardedAdEventType } from "react-native-google-mobile-ads";
  import Purchases from "react-native-purchases";

  async function showRewardedAd(impressionId: string) {
    const token = await Purchases.generateRewardVerificationToken(impressionId);

    const rewarded = RewardedAd.createForAdRequest("ca-app-pub-.../...", {
      serverSideVerificationOptions: { customData: token.customData },
      ...
    });

    rewarded.addAdEventListener(RewardedAdEventType.EARNED_REWARD, async () => {
      const result = await Purchases.pollRewardVerification(token.clientTransactionId);
      if (result.failed) {
        ...
        return;
      }
      grant(result.reward);
      result.moreRewards.forEach(grant);
    });

    rewarded.load();
    ...
  }

@peterporfy

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

@RevenueCat-Danger-Bot

Copy link
Copy Markdown
1 Error
🚫 Label the PR using one of the change type labels. If you are not sure which label to use, choose pr:other.
Label Description
pr:feat A new feature. Use along with pr:breaking to force a major release.
pr:fix A bug fix. Use along with pr:force_minor to force a minor release.
pr:other Other changes. Catch-all for anything that doesn't fit the above categories. Releases that only contain this label will not be released. Use along with pr:force_patch, or pr:force_minor to force a patch or minor release.
pr:RevenueCatUI Use along any other tag to mark a PR that only contains RevenueCatUI changes
pr:next_release Preparing a new release
pr:dependencies Updating a dependency
pr:phc_dependencies Updating purchases-hybrid-common dependency
pr:changelog_ignore The PR will not be included in the changelog. This label doesn't determine the type of bump of the version and must be combined with pr:feat, pr:fix or pr:other.

Generated by 🚫 Danger

@peterporfy peterporfy requested a review from polmiro June 29, 2026 15:45
@peterporfy peterporfy added the pr:feat A new feature label Jun 29, 2026
@polmiro polmiro removed their request for review July 2, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants