Skip to content

[in_app_purchase_android] Add showInAppMessages support (#107412)#11214

Open
fingerart wants to merge 1 commit into
flutter:mainfrom
riverolls:in_app_purchase_android
Open

[in_app_purchase_android] Add showInAppMessages support (#107412)#11214
fingerart wants to merge 1 commit into
flutter:mainfrom
riverolls:in_app_purchase_android

Conversation

@fingerart

@fingerart fingerart commented Mar 9, 2026

Copy link
Copy Markdown

As mentioned in #107412, a new native feature (showInAppMessages) has been added.

final androidPlatformAddition = InAppPurchase.instance.getPlatformAddition<InAppPurchaseAndroidPlatformAddition>();
final result = await androidPlatformAddition.showInAppMessages();

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the showInAppMessages API from the Google Play Billing Library. This includes defining the new API in Pigeon, implementing it on the Android native side, adding Dart wrappers, and updating the example app to demonstrate its usage. Tests for the new functionality have also been added.

@fingerart

Copy link
Copy Markdown
Author

@stuartmorgan-g @GaryQian What else do I need to do?

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

@fingerart You need to wait for a review, which as our docs explain takes up to a couple of weeks.

@stuartmorgan-g stuartmorgan-g added the triage-android Should be looked at in Android triage label Mar 10, 2026
@fingerart

Copy link
Copy Markdown
Author

There are 6 failed checks, what do I need to do about it?

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

There are 6 failed checks, what do I need to do about it?

You can see the task output by going to View details -> View more details on flutter-dashboard -> stdout.

In this case they are all analyzer failures, which should trivially show up locally in any IDE configured to read repo-local analysis options.

@fingerart fingerart force-pushed the in_app_purchase_android branch from 8d3a9cc to 410fa60 Compare April 2, 2026 02:12
@fingerart

Copy link
Copy Markdown
Author

I have fixed the error checking item.

@jesswrd jesswrd added the CICD Run CI/CD label Apr 7, 2026

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly lgtm, one question about future proofing re: the categories of message to show.

Also, it would be good to add a test to packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart as the other methods of in_app_purchase_android_platform_addition.dart are also tested there

something like

  group('showInAppMessages', () {
    test('showInAppMessages success', () async {
      const expected = InAppMessageResultWrapper(
        responseCode: InAppMessageResponse.subscriptionStatusUpdated,
        purchaseToken: 'dummy purchase token',
      );

      when(mockApi.showInAppMessages()).thenAnswer(
        (_) async => PlatformInAppMessageResult(
          responseCode: PlatformInAppMessageResponse.subscriptionStatusUpdated,
          purchaseToken: expected.purchaseToken,
        ),
      );

      final InAppMessageResultWrapper result =
          await iapAndroidPlatformAddition.showInAppMessages();

      expect(result, equals(expected));
    });
  });

@fingerart fingerart force-pushed the in_app_purchase_android branch from 410fa60 to 3200139 Compare April 15, 2026 03:29
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 15, 2026
@fingerart

Copy link
Copy Markdown
Author

I added the showInAppMessages success test to packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart.

@gmackall

Copy link
Copy Markdown
Member

lgtm, @bparrishMines would you like to do the secondary review?

@gmackall gmackall removed the triage-android Should be looked at in Android triage label Apr 21, 2026
@bparrishMines bparrishMines added the CICD Run CI/CD label Apr 29, 2026

@bparrishMines bparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple nits

Comment thread packages/in_app_purchase/in_app_purchase_android/pigeons/messages.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 30, 2026
@fingerart fingerart force-pushed the in_app_purchase_android branch from c72c1f7 to 2e060b6 Compare April 30, 2026 07:21
@bparrishMines

Copy link
Copy Markdown
Contributor

@fingerart This needs to merge in the main branch and handle merging the pigeon Kotlin update. This PR doesn't allow maintainers to make changes, so I can't do this for you.

@fingerart fingerart force-pushed the in_app_purchase_android branch 2 times, most recently from 2e060b6 to db93292 Compare May 20, 2026 04:12
@fingerart

Copy link
Copy Markdown
Author

@bparrishMines I have updated to Kotlin.

@bparrishMines bparrishMines added the CICD Run CI/CD label May 22, 2026

@bparrishMines bparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I think the version bump got messed up with the kotlin merge. The pubspec version needs to updated along with my comments in the changelog.

Comment thread packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Outdated
Comment thread packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Outdated
@fingerart fingerart force-pushed the in_app_purchase_android branch from db93292 to 503ead0 Compare May 22, 2026 18:04
@github-actions github-actions Bot removed the CICD Run CI/CD label May 22, 2026
Comment thread packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Outdated
Comment thread packages/in_app_purchase/in_app_purchase_android/pubspec.yaml Outdated
@fingerart fingerart force-pushed the in_app_purchase_android branch 3 times, most recently from 22ae8f4 to cdc35c7 Compare June 2, 2026 06:56
@bparrishMines bparrishMines added the CICD Run CI/CD label Jun 3, 2026
@flutter-dashboard

Copy link
Copy Markdown

This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled.

@bparrishMines bparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fingerart fingerart force-pushed the in_app_purchase_android branch from cdc35c7 to ba97bc9 Compare June 4, 2026 06:28
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 4, 2026
@fingerart fingerart force-pushed the in_app_purchase_android branch from ba97bc9 to 8b3523e Compare June 4, 2026 06:32
@bparrishMines bparrishMines added the CICD Run CI/CD label Jun 4, 2026
@fingerart fingerart force-pushed the in_app_purchase_android branch from 8b3523e to 5eac845 Compare June 5, 2026 04:06
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 5, 2026
@fingerart fingerart force-pushed the in_app_purchase_android branch from 5eac845 to 58b8b2c Compare June 8, 2026 02:00
@fingerart fingerart force-pushed the in_app_purchase_android branch from 58b8b2c to ee3e06a Compare June 11, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants