Aug 6, 2020 Replies: 33 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: 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. Click to expand... Use SDK Manager and install: B4X: Copy 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: Copy 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 InAppReviewExample.zip InAppReviewExample.zip 9.7 KB · Views: 619 InAppReviewLibrary.zip InAppReviewLibrary.zip 4.1 KB · Views: 681 Last edited: Jan 15, 2023 Click to expand...
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: 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. Click to expand... Use SDK Manager and install: B4X: Copy 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: Copy 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.
coldteam Active Member Licensed User Longtime User Sep 24, 2020 #21 asales said: Maybe an error? In-app reviews only work on the following devices: Android devices (phones and tablets) running Android 5.0 (API level 21) or higher that have the Google Play Store installed. Chrome OS devices that have the Google Play Store installed. Google Play In-App Reviews API | Other Play guides | Android Developers developer.android.com Click to expand... I read this I'm wondering if the library somehow handles this point?
asales said: Maybe an error? In-app reviews only work on the following devices: Android devices (phones and tablets) running Android 5.0 (API level 21) or higher that have the Google Play Store installed. Chrome OS devices that have the Google Play Store installed. Google Play In-App Reviews API | Other Play guides | Android Developers developer.android.com Click to expand... I read this I'm wondering if the library somehow handles this point?
Pendrush Well-Known Member Licensed User Longtime User Sep 24, 2020 #22 94.1% of all devices are API level 21+ at this moment.
coldteam Active Member Licensed User Longtime User Sep 24, 2020 #23 Pendrush said: View attachment 100477 94.1% of all devices are API level 21+ Click to expand... I understand that you use API 21+ in all your applications? But the question is, how does the library behave with API <21 or haven't you tried it?
Pendrush said: View attachment 100477 94.1% of all devices are API level 21+ Click to expand... I understand that you use API 21+ in all your applications? But the question is, how does the library behave with API <21 or haven't you tried it?
Pendrush Well-Known Member Licensed User Longtime User Sep 24, 2020 #24 As you can see in first post, I did not test this library, but two other members of this forum. I'm glad that you can clearly understand my API usage. You can also use code like this: B4X: Copy Dim p As Phone If p.SdkVersion < 21 Then 'dont use library End If
As you can see in first post, I did not test this library, but two other members of this forum. I'm glad that you can clearly understand my API usage. You can also use code like this: B4X: Copy Dim p As Phone If p.SdkVersion < 21 Then 'dont use library End If
coldteam Active Member Licensed User Longtime User Sep 24, 2020 #25 Pendrush said: As you can see in first post, I did not test this library, but two other members of this forum. I'm glad that you can clearly understand my API usage. You can also use code like this: B4X: Copy Dim p As Phone If p.SdkVersion < 21 Then 'dont use library End If Click to expand... ok, thanks for the clarification. i will test this.
Pendrush said: As you can see in first post, I did not test this library, but two other members of this forum. I'm glad that you can clearly understand my API usage. You can also use code like this: B4X: Copy Dim p As Phone If p.SdkVersion < 21 Then 'dont use library End If Click to expand... ok, thanks for the clarification. i will test this.
tufanv Expert Licensed User Longtime User Dec 1, 2020 #26 for me this does not work. both tried with fake enabled on local testing and fake disabled on store. Both of them makes my app get in to a infinite loop
for me this does not work. both tried with fake enabled on local testing and fake disabled on store. Both of them makes my app get in to a infinite loop
Pendrush Well-Known Member Licensed User Longtime User Dec 1, 2020 #27 Library is extremely simple, also there is nothing with a loop inside library.
asales Expert Licensed User Longtime User Dec 2, 2020 #28 I included this lib in a new app to test and works fine. Thanks!
tufanv Expert Licensed User Longtime User Dec 2, 2020 #29 asales said: I included this lib in a new app to test and works fine. Thanks! Click to expand... probably a problem on my side, will try again.
asales said: I included this lib in a new app to test and works fine. Thanks! Click to expand... probably a problem on my side, will try again.
tufanv Expert Licensed User Longtime User Dec 2, 2020 #30 This time I am getting 4-5 times onreviewcomplete event although it must be one, is it noprmal ? Pendrush said: Library is extremely simple, also there is nothing with a loop inside library. Click to expand...
This time I am getting 4-5 times onreviewcomplete event although it must be one, is it noprmal ? Pendrush said: Library is extremely simple, also there is nothing with a loop inside library. Click to expand...
Pendrush Well-Known Member Licensed User Longtime User Dec 2, 2020 #31 Do you call InAppReview.LaunchReview multiple times?
tufanv Expert Licensed User Longtime User Dec 2, 2020 #32 Yeah, I missed the pooint that activity_resume was firing the event again as on complete event was also firing the activity_resume. It fires once only now. Thanks !
Yeah, I missed the pooint that activity_resume was firing the event again as on complete event was also firing the activity_resume. It fires once only now. Thanks !
tufanv Expert Licensed User Longtime User Dec 3, 2020 #33 Works perfect, tested with release version. Thanks for great work!
benyamin Member Aug 14, 2023 #34 Thanks, can you add this method? It is very important for this library to understand whether the user can give the app a rating or not com.google.android.play.core.review.ReviewInfo Java: Copy Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo); flow.addOnCompleteListener(task -> { // The flow has finished. The API does not indicate whether the user // reviewed or not, or even whether the review dialog was shown. Thus, no // matter the result, we continue our app flow. });
Thanks, can you add this method? It is very important for this library to understand whether the user can give the app a rating or not com.google.android.play.core.review.ReviewInfo Java: Copy Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo); flow.addOnCompleteListener(task -> { // The flow has finished. The API does not indicate whether the user // reviewed or not, or even whether the review dialog was shown. Thus, no // matter the result, we continue our app flow. });