Пример #1
0
 public void Install()
 {
     Debug.Log("Installing game");
     WriteGameStateToCookie(_level, _score);
     Debug.Log("After writing GameState");
     ReadGameStateFromCookie();
     Debug.Log("After reading GameState");
     InstallLauncher.ShowInstallPrompt();
 }
Пример #2
0
    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
    }
Пример #3
0
 public void ButtonEventShowInstallPrompt()
 {
     // TODO: test all aspects of this API.
     InstallLauncher.ShowInstallPrompt();
 }