britannio / in_app_review

A Flutter plugin for showing the In-App Review/System Rating pop up on Android, IOS, and MacOS. It makes it easy for users to rate your app.
311 stars 81 forks source link

Android In-App Review not working in Emulator and Real Device #12

Closed Aravin closed 3 years ago

Aravin commented 3 years ago

Hi Team,

This is my code, on button click

Code

                final InAppReview inAppReview = InAppReview.instance;

                if (await inAppReview.isAvailable()) {
                  inAppReview.requestReview();
                } else {
                  inAppReview.openStoreListing();
                }

Logs

I/InAppReviewPlugin( 1428): onComplete: Successfully requested review flow
I/flutter ( 1428): true
I/InAppReviewPlugin( 1428): isAvailable: called
I/InAppReviewPlugin( 1428): isAvailable: playStoreInstalled: true
I/InAppReviewPlugin( 1428): isAvailable:lollipopOrLater: true
I/InAppReviewPlugin( 1428): isAvailable: The Play Store is available and Android 5 or later is being used
I/InAppReviewPlugin( 1428): cacheReviewInfo: called
I/PlayCore( 1428): UID: [10351]  PID: [1428] ReviewService : requestInAppReview (io.epix.warranty_manager)
I/InAppReviewPlugin( 1428): cacheReviewInfo: Requesting review flow
I/PlayCore( 1428): UID: [10351]  PID: [1428] ReviewService : Initiate binding to the service.
I/PlayCore( 1428): UID: [10351]  PID: [1428] ReviewService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.inappreviewservice.InAppReviewService})
I/PlayCore( 1428): UID: [10351]  PID: [1428] ReviewService : linkToDeath
I/PlayCore( 1428): UID: [10351]  PID: [1428] OnRequestInstallCallback : onGetLaunchReviewFlowInfo
britannio commented 3 years ago

Looks similar to https://github.com/britannio/in_app_review/issues/2 1) Are you following https://github.com/britannio/in_app_review/tree/master/in_app_review#android-1 and testing your app from the Play Store? 2) isAvailable() can return true but it doesn't guarantee that requestReview() will display the review dialog as the quota may have been exceeded so it's not recommended to use requestReview() in response to a button being pressed. openStoreListing() should be used instead in such a scenario.

Rob-rob-bot commented 3 years ago

I have the same issue, does not work in real device, installed with internal testing. I have never reviewed with the profile so it would be impossible to have reached the quota

britannio commented 3 years ago

@Rob-rob-bot Are you running code equivalent to this?

import 'package:in_app_review/in_app_review.dart';

final InAppReview inAppReview = InAppReview.instance;

if (await inAppReview.isAvailable()) {
    inAppReview.requestReview();
}

If you are using requestReview() on a compatible device and testing your app via internal app sharing then the review popup should appear every time.

Rob-rob-bot commented 3 years ago

@britannio I am using code like that in an Android 10 real device with play store installed, with internal test and the review flow does not start wen I call requestReview() Shouldn't internal testing deliver the same results as the shortened app sharing flow? Any way I will try and let you know.

britannio commented 3 years ago

Shouldn't internal testing deliver the same results as the shortened app sharing flow?

It should be the same however I've only tested this via internal app sharing as it takes less time to setup.

britannio commented 3 years ago

@Rob-rob-bot Are you still facing any issues with this plugin?

NaosFr commented 3 years ago

Hello, nothing happens with this code:

if (await _inAppReview.isAvailable()) {
        _inAppReview.requestReview()'
} else {
        if (Platform.isAndroid)
          _inAppReview.openStoreListing(appStoreId: ....);
        else
          _inAppReview.openStoreListing(appStoreId: ....);
}

Any idea ?

Aravin commented 3 years ago

@NicolasCELLA

It should be working on the supported device.

This is my implementation

https://github.com/Aravin/WarrantyManager/blob/a4e6f9ed3dfa5fec9e8ddc075a48c3f3a3c841ab/lib/screens/home.dart#L108

This is my application

https://play.google.com/store/apps/details?id=io.epix.warranty_manager

Working fine.

britannio commented 3 years ago

@NicolasCELLA Can you confirm that you are following the guidelines? There are also testing instructions.

If _inAppReview.isAvailable() returns true, it doesn't guarantee that the review prompt will be shown as the quota of the underlying API may have been exceeded. Because of this, it's advised to not use rely on requestReview() to let a user review your app as a result of a button being pressed.

Also, _inAppReview.openStoreListing(appStoreId: ....); works on Android, IOS, MacOS and Windows with a single call so you don't need to check if the platform is Android.

tajaouart commented 3 years ago

Same issue on real device (Samsung), The app is already published on playStore, only OpenStoreListing works

britannio commented 3 years ago

Same issue on real device (Samsung), The app is already published on playStore, only OpenStoreListing works

@tajaouart You've likely exceeded the quota on your device: https://developer.android.com/guide/playcore/in-app-review#quotas If you'd still like to test out the pop up then install your app via internal app sharing.

britannio commented 3 years ago

@Aravin Are you still facing any issues with this plugin?

tajaouart commented 3 years ago

@Aravin It didn't even appear once so there is no problem related to quota..., i want it to work not just to see it.

britannio commented 3 years ago

@Aravin It didn't even appear once so there is no problem related to quota..., i want it to work not just to see it.

@tajaouart Did you install the app via internal app sharing?

alex9153 commented 3 years ago

I have the same issue

I/InAppReviewPlugin(20890): requestReview: called
I/PlayCore(20890): UID: [11467]  PID: [20890] ReviewService : requestInAppReview (app.....android)
I/InAppReviewPlugin(20890): requestReview: Requesting review flow
I/PlayCore(20890): UID: [11467]  PID: [20890] ReviewService : Initiate binding to the service.
I/PlayCore(20890): UID: [11467]  PID: [20890] ReviewService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.inappreviewservice.InAppReviewService})
I/PlayCore(20890): UID: [11467]  PID: [20890] ReviewService : linkToDeath
I/PlayCore(20890): UID: [11467]  PID: [20890] OnRequestInstallCallback : onGetLaunchReviewFlowInfo
I/PlayCore(20890): UID: [11467]  PID: [20890] ReviewService : Unbind from service.
I/InAppReviewPlugin(20890): onComplete: Successfully requested review flow
I/InAppReviewPlugin(20890): launchReviewFlow: called
W/ActivityThread(20890): handleWindowVisibility: no activity for token android.os.BinderProxy@38ce6f7
4
V/StudioTransport(20890): Handling agent command 1200 for pid: 20890.
W/JavaBinder(20890): BinderProxy is being destroyed but the application did not call unlinkToDeath to unlink all of its death recipients beforehand.  Releasing leaked death recipient: com.google.android.play.core.internal.ai
V/StudioTransport(20890): Handling agent command 1200 for pid: 20890.
I/chatty  (20890): uid=11467(app.....android) Thread-3 identical 2 lines
4
V/StudioTransport(20890): Handling agent command 1200 for pid: 20890.
W/ConnectionTracker(20890): Exception thrown while unbinding
W/ConnectionTracker(20890): java.lang.IllegalArgumentException: Service not registered: ls@7d23fda
W/ConnectionTracker(20890):     at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1562)
W/ConnectionTracker(20890):     at android.app.ContextImpl.unbindService(ContextImpl.java:1692)
W/ConnectionTracker(20890):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:717)
W/ConnectionTracker(20890):     at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204713067@20.47.13 (100408-0):1)
W/ConnectionTracker(20890):     at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204713067@20.47.13 (100408-0):2)
W/ConnectionTracker(20890):     at lt.E(:com.google.android.gms.dynamite_measurementdynamite@204713067@20.47.13 (100408-0):9)
W/ConnectionTracker(20890):     at ld.a(:com.google.android.gms.dynamite_measurementdynamite@204713067@20.47.13 (100408-0):3)
W/ConnectionTracker(20890):     at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204713067@20.47.13 (100408-0):3)
W/ConnectionTracker(20890):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
W/ConnectionTracker(20890):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
britannio commented 3 years ago

@alex9153 Are you following the testing instructions? https://github.com/britannio/in_app_review#android

tajaouart commented 3 years ago

@britannio No i did not install the app via internal app sharing, the application is already published in PlayStore, so it is supposed to work right ?

britannio commented 3 years ago

@britannio No i did not install the app via internal app sharing, the application is already published in PlayStore, so it is supposed to work right ?

If it works in internal app sharing then it will work when your app is published although the quota restrictions are enforced when you publish the app so I encourage you to first test your app via internal app sharing. If it still doesn't work then let me know.

alex9153 commented 3 years ago

@alex9153 Are you following the testing instructions? https://github.com/britannio/in_app_review#android

My app is live in the Google Play. When I call requestReview() nothing happens. Should I configure google play console or google developer console somehow ?

britannio commented 3 years ago

@alex9153 Are you following the testing instructions? https://github.com/britannio/in_app_review#android

My app is live in the Google Play. When I call requestReview() nothing happens. Should I configure google play console or google developer console somehow ?

This will happen if the quota described here is exceeded. requestReview() isn't designed to show the pop up every time when you've installed the production version of your app.

Let me know if you find the usage instructions and guidelines confusing.

alex9153 commented 3 years ago

This will happen if the quota described here is exceeded. requestReview()

I call isAvailable() before requestReview() it returns true and nothing happens.

britannio commented 3 years ago

This will happen if the quota described here is exceeded. requestReview()

I call isAvailable() before requestReview() it returns true and nothing happens.

isAvailable() only checks if the device supports requestReview() but doesn't guarantee that requestReview() will show the review pop up. Please follow the testing instructions, either from the README or from the underlying Android API. If you still can't get requestReview() to show the review dialog after installing the app via internal app sharing then let me know.

britannio commented 3 years ago

@NicolasCELLA @tajaouart @alex9153 Are any of you still facing issues with this plugin? I don't think that there is an issue with the plugin itself.

RowanG1Bilue commented 3 years ago

I am still having this issue. Did you get it resolved?

britannio commented 3 years ago

@RowanG1Bilue Are you following the exact testing instructions? https://github.com/britannio/in_app_review/tree/master/in_app_review#testing

yashmittalJTG commented 2 years ago

@britannio onComplete: Unsuccessfully requested review flow i got this error,

tajaouart commented 2 years ago

2022 still having the issue, internal testing + production. I did get the review view appear just once, the first time.

I/InAppReviewPlugin(14082): onMethodCall: isAvailable I/InAppReviewPlugin(14082): isAvailable: called I/InAppReviewPlugin(14082): noContextOrActivity: called I/InAppReviewPlugin(14082): isAvailable: playStoreInstalled: true I/InAppReviewPlugin(14082): isAvailable: lollipopOrLater: true I/InAppReviewPlugin(14082): isAvailable: The Play Store is available and Android 5 or later is being used I/InAppReviewPlugin(14082): cacheReviewInfo: called I/InAppReviewPlugin(14082): noContextOrActivity: called I/PlayCore(14082): UID: [10452] PID: [14082] ReviewService : requestInAppReview ([package id] ) I/InAppReviewPlugin(14082): cacheReviewInfo: Requesting review flow I/PlayCore(14082): UID: [10452] PID: [14082] ReviewService : Initiate binding to the service. I/PlayCore(14082): UID: [10452] PID: [14082] ReviewService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.inappreviewservice.InAppReviewService}) I/PlayCore(14082): UID: [10452] PID: [14082] ReviewService : linkToDeath I/PlayCore(14082): UID: [10452] PID: [14082] OnRequestInstallCallback : onGetLaunchReviewFlowInfo I/PlayCore(14082): UID: [10452] PID: [14082] ReviewService : Unbind from service. I/InAppReviewPlugin(14082): onComplete: Successfully requested review flow I/InAppReviewPlugin(14082): onMethodCall: requestReview I/InAppReviewPlugin(14082): requestReview: called I/InAppReviewPlugin(14082): noContextOrActivity: called I/InAppReviewPlugin(14082): launchReviewFlow: called I/InAppReviewPlugin(14082): noContextOrActivity: called I/DecorView(14082): [INFO] isPopOver=false, config=true I/DecorView(14082): updateCaptionType >> DecorView@1218c1b[], isFloating=true, isApplication=true, hasWindowControllerCallback=true, hasWindowDecorCaption=false D/DecorView(14082): setCaptionType = 0, this = DecorView@1218c1b[] D/NativeCustomFrequencyManager(14082): [NativeCFMS] BpCustomFrequencyManager::BpCustomFrequencyManager() I/DecorView(14082): notifyKeepScreenOnChanged: keepScreenOn=false I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): setView = com.android.internal.policy.DecorView@1218c1b TM=true I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): Relayout returned: old=(0,0,1080,2340) new=(540,1219,540,1219) req=(0,0)0 dur=8 res=0x7 s={true 499479983792} ch=true fn=-1 D/OpenGLRenderer(14082): eglCreateWindowSurface I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11420 android.view.ViewRootImpl.performTraversals:4193 android.view.ViewRootImpl.doTraversal:2919 D/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): Creating frameDrawingCallback nextDrawUseBlastSync=false reportNextDraw=true hasBlurUpdates=false D/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): Creating frameCompleteCallback I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): [DP] pdf(0) 1 android.view.ViewRootImpl.performDraw:5207 android.view.ViewRootImpl.performTraversals:4212 android.view.ViewRootImpl.doTraversal:2919 I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): [DP] rdf() D/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): reportDrawFinished (fn: -1) D/InsetsSourceConsumer(14082): ensureControlAlpha: for ITYPE_NAVIGATION_BAR on [packageID]/com.google.android.play.core.common.PlayCoreDialogWrapperActivity D/InsetsSourceConsumer(14082): ensureControlAlpha: for ITYPE_STATUS_BAR on [packageID]/com.google.android.play.core.common.PlayCoreDialogWrapperActivity I/ViewRootImpl@da5180e[MainActivity](14082): MSG_WINDOW_FOCUS_CHANGED 0 1 I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): MSG_WINDOW_FOCUS_CHANGED 0 1 I/ViewRootImpl@da5180e[MainActivity](14082): stopped(false) old=false I/DecorView(14082): notifyKeepScreenOnChanged: keepScreenOn=false D/InsetsSourceConsumer(14082): ensureControlAlpha: for ITYPE_NAVIGATION_BAR on [packageID]/[packageID].MainActivity D/InsetsSourceConsumer(14082): ensureControlAlpha: for ITYPE_STATUS_BAR on [packageID]/[packageID].MainActivity I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): MSG_WINDOW_FOCUS_CHANGED 0 1 I/ViewRootImpl@da5180e[MainActivity](14082): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=3 res=0x1 s={true 499479687312} ch=false fn=3 I/ViewRootImpl@da5180e[MainActivity](14082): updateBoundsLayer: t = android.view.SurfaceControl$Transaction@1340fb3 sc = Surface(name=Bounds for - [packageID]/[packageID].MainActivity@0)/@0x7656970 frame = 3 I/ViewRootImpl@da5180e[MainActivity](14082): mWNT: t = android.view.SurfaceControl$Transaction@1340fb3 fN = 3 android.view.ViewRootImpl.prepareSurfaces:2778 android.view.ViewRootImpl.performTraversals:4024 android.view.ViewRootImpl.doTraversal:2919 I/ViewRootImpl@da5180e[MainActivity](14082): mWNT: merge t to BBQ I/ViewRootImpl@da5180e[MainActivity](14082): MSG_WINDOW_FOCUS_CHANGED 1 1 D/InputMethodManager(14082): startInputInner - Id : 0 I/InputMethodManager(14082): startInputInner - mService.startInputOrWindowGainedFocus I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): stopped(true) old=false D/OpenGLRenderer(14082): setSurface called with nullptr D/OpenGLRenderer(14082): setSurface() destroyed EGLSurface D/OpenGLRenderer(14082): destroyEglSurface I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): dispatchDetachedFromWindow D/InputTransport(14082): Input channel destroyed: '10f2bf9', fd=140 I/ViewRootImpl@bdb11b8[PlayCoreDialogWrapperActivity](14082): handleAppVisibility mAppVisible=true visible=false

Waruna-Kaushalya commented 1 year ago

@tajaouart Yes, the review view will appear only once per phone, regardless of user review or not. Did you get a solution for this?

Waruna-Kaushalya commented 1 year ago

@tajaouart I got this from stackoverflow. "To provide a great user experience, Google Play enforces a time-bound quota on how often a user can be shown the review dialog. Because of this quota, calling the launchReviewFlow method more than once during a short period of time (for example, less than a month) might not always display a dialog." https://stackoverflow.com/questions/70564280/in-app-review-popup-window-not-showing-again-once-not-now-is-pressed

britannio commented 1 year ago

I am curious if this is a proguard issue and if https://github.com/britannio/in_app_review/issues/68#issuecomment-1250256853 fixes it.

amcny commented 8 months ago

@NicolasCELLA

It should be working on the supported device.

This is my implementation

https://github.com/Aravin/WarrantyManager/blob/a4e6f9ed3dfa5fec9e8ddc075a48c3f3a3c841ab/lib/screens/home.dart#L108

This is my application

https://play.google.com/store/apps/details?id=io.epix.warranty_manager

Working fine.

how does it works. can you please explain your implementation. i didnt understand else condition, where you used inAppReview.openStoreListing();