代码之家  ›  专栏  ›  技术社区  ›  Anand Phadke

何时在应用程序中查看用户分级API如何回调

  •  0
  • Anand Phadke  · 技术社区  · 4 年前

    我已经实现了GoogleIn-AppReviewAPI,并从onCreate方法启动

    private void inAppReviewDialog(Context context) {
    
        ReviewManager manager = ReviewManagerFactory.create(context);
    
        Task<ReviewInfo> request = manager.requestReviewFlow();
        request.addOnCompleteListener(task -> {
            if (task.isSuccessful()) {
                // We can get the ReviewInfo object
                ReviewInfo reviewInfo = task.getResult();
                Task<Void> flow = manager.launchReviewFlow((Activity) context, reviewInfo);
                flow.addOnCompleteListener(task1 -> {
                    // 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.
                    Log.v(this.getClass().getName(),"In Dialog Success");
                });
    
            }else {
                Log.v(this.getClass().getName(),"In Dialog failed");
            }
        });
    
    
    }
    

    0 回复  |  直到 4 年前