Hello everyone, and I have a problem. I want the user to write a review inside the game and then submit it to the game page in the play market. I found a way to send text to any site. But also found how to open play market review. There are:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using Google.Play.Review;
public class FeedbackField : MonoBehaviour
{
public Button sendButton;
public InputField inputUser;
private ReviewManager _reviewManager;
public string URL = "my game page";
void Start()
{
sendButton.onClick.AddListener(ShowTheReview);
}
//Way 1
public void Send()
{
StartCoroutine(Post(inputUser.text));
}
IEnumerator Post(string text)
{
WWWForm form = new WWWForm();
form.AddField("", text);
UnityWebRequest www = UnityWebRequest.Post(URL, form);
yield return form;
}
//End
//Way 2
public void ShowTheReview()
{
StartCoroutine(StartTheReview());
}
public IEnumerator StartTheReview()
{
_reviewManager = new ReviewManager();
var requestFlowOperation = _reviewManager.RequestReviewFlow();
yield return requestFlowOperation;
if (requestFlowOperation.Error != ReviewErrorCode.NoError)
{
yield break;
}
var _playReviewInfo = requestFlowOperation.GetResult();
var launchFlowOperation = _reviewManager.LaunchReviewFlow(_playReviewInfo);
yield return launchFlowOperation;
_playReviewInfo = null;
if (launchFlowOperation.Error != ReviewErrorCode.NoError)
{
yield break;
}
}
//End
}
So, I want to combine these two ways. The user writes text in the input field, then when the button is clicked, a page in the play market opens with a review already filled out.