public void Install() { Debug.Log("Installing game"); WriteGameStateToCookie(_level, _score); Debug.Log("After writing GameState"); ReadGameStateFromCookie(); Debug.Log("After reading GameState"); InstallLauncher.ShowInstallPrompt(); }
public void DoInstallClick() { Debug.Log("DoInstallClick"); #if PLAY_INSTANT Debug.LogFormat("Cookie max size: {0}", CookieApi.GetInstantAppCookieMaxSizeBytes()); var result = CookieApi.SetInstantAppCookie("test-cookie"); Debug.LogFormat("Set cookie result: {0}", result); using (var activity = UnityPlayerHelper.GetCurrentActivity()) using (var postInstallIntent = InstallLauncher.CreatePostInstallIntent(activity)) { InstallLauncher.PutPostInstallIntentStringExtra(postInstallIntent, "payload", "test-payload-value"); InstallLauncher.ShowInstallPrompt(activity, 1234, postInstallIntent, "test-referrer"); } #else Debug.LogErrorFormat("Intent result: \"{0}\"", InstallLauncher.GetPostInstallIntentStringExtra("payload")); Debug.LogErrorFormat("Cookie: \"{0}\"", CookieApi.GetInstantAppCookie()); #endif }
public void ButtonEventShowInstallPrompt() { // TODO: test all aspects of this API. InstallLauncher.ShowInstallPrompt(); }