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
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}";
try
{
context.PackageManager.GetPackageInfo("com.android.vending", PackageInfoFlags.Activities);
Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url));
context.StartActivity(intent);
}
catch (PackageManager.NameNotFoundException ex)
{
// this won't happen. But catching just in case the user has downloaded the app without having Google Play installed.
Console.WriteLine(ex.Message);
}
catch (ActivityNotFoundException)
{
// if Google Play fails to load, open the App link on the browser
if (!string.IsNullOrEmpty(packageName))
{
var playStoreUrl = "https://play.google.com/store/apps/details?id=" + 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);
context.StartActivity(browserIntent);
}
}
}
}
}
@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.
Answers
Checkout: https://github.com/jamesmontemagno/StoreReviewPlugin
This code for Android
@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.