同じSceneの表示が3回されるごとにアプリレビューを表示させたく、下記のコードを書きましたが、アプリレビューが表示されませんでした。
Sceneに移行した際にユーザーがアプリ自体を一旦消した後でもそのSceneの表示回数がセーブされるようにしたいのですがどうしてもできません。
解決のアドバイスをいただけますと幸いです。
C#
1//一部抜粋 2using System.Collections; 3using System.Collections.Generic; 4using UnityEngine; 5using UnityEngine.UI; 6using UnityEngine.SceneManagement; 7#if UNITY_IOS 8using UnityEngine.iOS; 9#endif 10 11public class a : MonoBehaviour 12{ 13 14private int count ; 15private string countSceneKey = "countScene"; 16 17void Start() 18 { 19 20 OnCount(); 21 count = PlayerPrefs.GetInt(countSceneKey,0); 22 23 24 25 if (count % 3 == 0 && count!=0) 26 { 27 Invoke("ShowReview", 1); 28 29 } 30 31 32 } 33 34public void OnCount() 35 { 36 count++; 37 Save(); 38 39 } 40 41public void Save() 42 { 43 // 表示回数を保存する 44 PlayerPrefs.SetInt(countSceneKey, count); 45 PlayerPrefs.Save(); 46 47 48 } 49 50 51 public void ShowReview() 52 { 53 #if UNITY_IOS 54 if (Device.RequestStoreReview()) 55 { 56 //レビュー出た 57 } 58 59 //Androidやそれ以外の場合の処理 60 #else 61 62 #endif 63 } 64}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/02/03 05:54