Forum Xamarin.Forms

How to rate google play app in application?

I want to rate my application directly in my app how can i make this?
Device.OpenUri(new Uri("details?id=packagename"));
with this i open in browser but i want to rate directly inside of the app

Best Answer


  • LearnEverythingLearnEverything USMember ✭✭✭

    This code for Android

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Android.App;
    using Android.Content;
    using Android.Content.PM;
    using Android.OS;
    using Android.Runtime;
    using Android.Views;
    using Android.Widget;
    namespace XamarinAndroid.Basic.Helpers
        public class SupportHelper
            public static void RateAndReview(Context context, string packageName = null)
                var url = $"market://details?id={context?.PackageName}";
                    context.PackageManager.GetPackageInfo("", PackageInfoFlags.Activities);
                    Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url));
                catch (PackageManager.NameNotFoundException ex)
                    // this won't happen. But catching just in case the user has downloaded the app without having Google Play installed.
                catch (ActivityNotFoundException)
                    // if Google Play fails to load, open the App link on the browser 
                    if (!string.IsNullOrEmpty(packageName))
                        var playStoreUrl = "" + packageName; //Add here the url of your application on the store
                        var browserIntent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(playStoreUrl));
                        browserIntent.AddFlags(ActivityFlags.NewTask | ActivityFlags.ResetTaskIfNeeded);
  • _Jai_Jai USMember ✭✭

    @LearnEverything is it navigating to play store for review and reating? because I tried but doesn't not get that small popup to one play store to go to playstore ? can you help me with this may b I am missing something.

Sign In or Register to comment.