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
Copy link
Copy Markdown

@fingerart fingerart commented Mar 9, 2026

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

Copy link
Copy Markdown

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

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
Copy link
Copy Markdown
Member

@gmackall gmackall left a comment

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
Copy link
Copy Markdown
Contributor

@bparrishMines bparrishMines left a comment

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
Copy link
Copy Markdown
Contributor

@bparrishMines bparrishMines left a comment

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.

## 0.4.0+11

* Updates internal implementation to use Kotlin Pigeon.
* Add showInAppMessages support for Android platform.
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 should be more descriptive. Something like:

Suggested change
* Add showInAppMessages support for Android platform.
* Adds support to overlay billing related messages. See
`InAppPurchaseAndroidPlatformAddition.showInAppMessages`.

## 0.4.0+11

* Updates internal implementation to use Kotlin Pigeon.
* Add showInAppMessages support for Android platform.
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 needs to be moved to it's own version bump above this one. (e.g. 0.4.1)

Copy link
Copy Markdown
Author

@fingerart fingerart May 22, 2026

Choose a reason for hiding this comment

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

I generated the new version and changelog using update-release-info.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@stuartmorgan-g Are there still any problems?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fingerart I'm not sure why you are pinging me, since a) I'm not a reviewer for this PR, and b) the PR is clearly under active review.

Are you attempting to escalate your review because you didn't get a re-review within one business day of pushing an update? If so, please refer back to the documentation I linked you to originally about review expectations.

@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
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