Review Unity (AOS/iOS)

2022. 3. 15. 13:46기술/외부 라이브러리

반응형

테스트 시 구글 플레이 콘솔 내부 테스트에라도 올려두고 다운로드 받아서 테스트하여야 합니다.

 

인앱 리뷰 통합(Unity)  |  Android 개발자  |  Android Developers

 

인앱 리뷰 통합(Unity)  |  Android 개발자  |  Android Developers

인앱 리뷰 통합(Unity) 이 가이드에서는 Unity를 사용하여 앱에 인앱 리뷰를 통합하는 방법을 설명합니다. Kotlin 또는 자바를 사용하거나 네이티브 코드를 사용한다면 별도의 통합 가이드를 참고하

developer.android.com

 

Google Play Core 라이브러리 개요  |  Android 개발자  |  Android Developers

 

Google Play Core 라이브러리 개요  |  Android 개발자  |  Android Developers

Google Play Core 라이브러리 개요 이 페이지에서는 Google Play Core 라이브러리에 관한 정보와 프로젝트에 이 라이브러리를 추가하는 방법을 설명합니다. Play Core란 무엇인가요? Play Core 라이브러리는 Go

developer.android.com

 

com.google.play.review-1.7.0.unitypackage

다운로드 > 임포트 할 때 중복되는 폴더 있는지 잘 확인

 

Releases · google/play-unity-plugins (github.com)

 

Releases · google/play-unity-plugins

The Google Play Plugins for Unity provide C# APIs for accessing various Play services - google/play-unity-plugins

github.com

 

iOS' native Review API plugin - Unity Forum

 

iOS' native Review API plugin

Edit: Hey folks - Unity now has this built into the engine, so no need to use my plugin :) See here:...

forum.unity.com

 

코드

using Google.Play.Review;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

#if (UNITY_IOS && !UNITY_EDITOR)
using System.Runtime.InteropServices;
#endif

public class Review : MonoBehaviour
{
    public void OnClickRevew()
    {
        switch (Application.platform)
        {
            case RuntimePlatform.Android:
                StartCoroutine(AOSReview());
                break;

            case RuntimePlatform.IPhonePlayer:
                iOSReview();
                break;
        }
    }

    IEnumerator AOSReview()
    {
        ReviewManager rm = new ReviewManager();
        var requestFlowOperation = rm.RequestReviewFlow();
        yield return requestFlowOperation;
        if (requestFlowOperation.Error != ReviewErrorCode.NoError)
        {
            Debug.LogFormat("requestFlowOperation:{0}", requestFlowOperation.Error);
            yield break;
        }
        PlayReviewInfo playReviewInfo = requestFlowOperation.GetResult();
        var launchFlowOperation = rm.LaunchReviewFlow(playReviewInfo);
        yield return launchFlowOperation;
        playReviewInfo = null; // Reset the object
        if (launchFlowOperation.Error != ReviewErrorCode.NoError)
        {
            // Log error. For example, using requestFlowOperation.Error.ToString().
            yield break;
        }
        Debug.Log("open review over !");
    }

#if (UNITY_IOS && !UNITY_EDITOR)
    [DllImport ("__Internal")]
    private static extern void requestReview();
#endif

    public static void iOSReview()
    {
#if (UNITY_IOS && !UNITY_EDITOR)
		Debug.Log("Trying to request the review window.");
	    requestReview();
#endif
    }
}

 

 

 


 

반응형