Before you begin, please read THIS and THIS. You can also read Medium article Demystifying the new Play In-App Review API (thanks @fredo).
Requirements:
Use SDK Manager and install:
Example app is attached to this post.
OnComplete event will fire immediately after you click on button in example app. This behavior is normal for example app, but app in production (app downloaded from Play Store) should show dialog like this:
OnComplete event will fire after dialog is closed.
You need to set minSdkVersion="21" and to add this in your manifest:
Download library zip file and extract archive to Additional Libraries folder.
Example app will trigger OnError event in emulator.
Thanks to: @ronnhdf and @Jack Cole for testing.
v2.01:
Requirements:
- Android devices (phones and tablets) running Android 5.0 (API level 21) or higher that have the Google Play Store installed.
- App minSdkVersion="21"
- Please check manifest in app example.
- After implementation, app must be uploaded to Play Store and downloaded from Play Store (beta test should work). If app is not downloaded from Play Store dialog will not work, OnComplete event will fire immediately.
InAppReview
Author: Author: Google - B4a Wrapper: Pendrush
Version: 2.01
- InAppReview
- Events:
- OnComplete
- OnError (Error As String)
- Functions:
- Initialize (EventName As String, UseFakeReviewManager As Boolean)
Initialize InAppReview
UseFakeReviewManager = True - This should only be used for unit or integration tests to verify the behaviour of the app once the review is completed.
Note: FakeReviewManager does not simulate the UI (no pop-up will be shown). It only fakes the API method result by always providing a fake ReviewInfo object and returning a success status when the in-app review flow is launched.
UseFakeReviewManager = False - Use it for production app.
InAppReview.Initialize("InAppReview", False)- LaunchReview
Launch review process. Pop-up window will show only for app downloaded from Play Store (Production app).
OnComplete event will fire immediately if you initialize with UseFakeReviewManager = True
Emulator will rise OnError event.
Use SDK Manager and install:
B4X:
com.google.android.play:review
com.google.android.gms:play-services-tasks
com.google.android.play:core-common
Example app is attached to this post.
OnComplete event will fire immediately after you click on button in example app. This behavior is normal for example app, but app in production (app downloaded from Play Store) should show dialog like this:
OnComplete event will fire after dialog is closed.
You need to set minSdkVersion="21" and to add this in your manifest:
B4X:
AddApplicationText(<activity
android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
android:exported="false"
android:stateNotNeeded="true"
android:theme="@style/Theme.PlayCore.Transparent" />)
Download library zip file and extract archive to Additional Libraries folder.
Example app will trigger OnError event in emulator.
Thanks to: @ronnhdf and @Jack Cole for testing.
v2.01:
- Library update to use com.google.android.play:review as InAppReview will be removed from com.google.android.play:core. The Google Play Core Java and Kotlin library have been split into multiple separate libraries, one for each feature.
- Manifest update.
- Example app update (only manifest).
- Some permissions removed.
- Library dependencies has changed.
Attachments
Last edited: