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

System Review Popup is not being displayed. #5

Closed shantiwebsolution closed 4 years ago

shantiwebsolution commented 4 years ago

System Review Pop up is not being displayed. I have wrote following code inside initState() function.

    WidgetsBinding.instance.addPostFrameCallback((_) async{
      if (await _inAppReview.isAvailable()) {
        print("WidgetsBinding Available");
        _inAppReview.requestReview();
      }
    });

Following is my debug log

I/PlayCore( 2860): UID: [10042]  PID: [2860] ReviewService : requestInAppReview (com.shantiwebsolution.bollywood_quiz)
I/PlayCore( 2860): UID: [10042]  PID: [2860] ReviewService : Initiate binding to the service.
I/PlayCore( 2860): UID: [10042]  PID: [2860] ReviewService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.inappreviewservice.InAppReviewService})
I/PlayCore( 2860): UID: [10042]  PID: [2860] ReviewService : linkToDeath
I/PlayCore( 2860): UID: [10042]  PID: [2860] OnRequestInstallCallback : onGetLaunchReviewFlowInfo
I/PlayCore( 2860): UID: [10042]  PID: [2860] ReviewService : Unbind from service.
I/flutter ( 2860): WidgetsBinding Available
I/Timeline( 2860): Timeline: Activity_launch_request id:com.shantiwebsolution.bollywood_quiz time:74560055
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : requestUpdateInfo(com.shantiwebsolution.bollywood_quiz)
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : Initiate binding to the service.
D/ViewRootImpl( 2860): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{2cc92c1 I.E...... R.....I. 0,0-0,0}
D/mali_winsys( 2860): new_window_surface returns 0x3000,  [1x1]-format:1
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateService})
D/ViewRootImpl( 2860): MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : linkToDeath
I/Timeline( 2860): Timeline: Activity_idle id: android.os.BinderProxy@f049bbc time:74560188
I/PlayCore( 2860): UID: [10042]  PID: [2860] OnRequestInstallCallback : onRequestInfo
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : Unbind from service.
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : requestUpdateInfo(com.shantiwebsolution.bollywood_quiz)
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : Initiate binding to the service.
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.installservice.DevTriggeredUpdateService})
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : linkToDeath
I/Timeline( 2860): Timeline: Activity_idle id: android.os.BinderProxy@3df8d69 time:74560426
D/ViewRootImpl( 2860): #3 mView = null
I/PlayCore( 2860): UID: [10042]  PID: [2860] OnRequestInstallCallback : onRequestInfo
I/PlayCore( 2860): UID: [10042]  PID: [2860] AppUpdateService : Unbind from service.
britannio commented 4 years ago

@shantiweb Can you confirm that you're following the testing instructions correctly? https://github.com/britannio/in_app_review#android-1

chris-rutkowski commented 4 years ago

I have exactly the same issue.

            if (await inAppReview.isAvailable()) {
              await inAppReview.requestReview();
            } else {
              await inAppReview.openStoreListing(appStoreId: '1526425219');
            }

I managed to see the popup maybe once, but that's all. You can see exactly above code in action if you download my app https://well-spoken.app . I came up with some lame walkaround (you can see it when you download my app), but it's not the ideal solution.

britannio commented 4 years ago

@chris-rutkowski image I certainly didn't make this clear enough when I first released this plugin but the system API's are not designed to be used in this way. On Android, after the first attempt at showing the pop-up, there's no guarantee that it will be shown again and this is an intentional limitation likely to prevent spam or misuse. https://developer.android.com/guide/playcore/in-app-review#quotas

Please follow the guidelines as stated here: https://developer.android.com/guide/playcore/in-app-review#when-to-request

Also, I'm loving the app UX!

britannio commented 4 years ago

As a side note, this quota is not enforced when running the app via internal app sharing or internal testing provided by the Google Play Store as stated here: https://developer.android.com/guide/playcore/in-app-review/test#test-play-store

chris-rutkowski commented 4 years ago

Thanks for compliment. So our code is correct, but Google and Apple is throating it, that's understandable. Is there any callback possible to understand what happens on the screen? I tried to wrap code in try catch but to no avail.

britannio commented 4 years ago

Thanks for compliment. So our code is correct, but Google and Apple is throating it, that's understandable. Is there any callback possible to understand what happens on the screen? I tried to wrap code in try catch but to no avail.

@chris-rutkowski Unfortunately not, the Google and Apple API don't let us know if the pop up was shown hence making it unsuitable for a permanent button. You can use the following code for your 'Rate us in the Play Store' button: await inAppReview.openStoreListing(appStoreId: '1526425219');

For your app, you could use the following code after a certain number of words have been learnt?

if (await inAppReview.isAvailable()) {
  await inAppReview.requestReview()
}
britannio commented 4 years ago

@shantiweb I haven't received a response from you so I'm closing this issue.

shantiwebsolution commented 4 years ago

Sorry, I was sick for last week. This works perfectly.

Only thing is we can not test in development. But can test in beta tests .