public override void Test() { var state = AN_PermissionsManager.CheckSelfPermission(AMM_ManifestPermission.READ_CONTACTS); switch (state) { case AN_PackageManager.PermissionState.Granted: AN_Logger.Log("READ_CONTACTS Permission Granted"); break; case AN_PackageManager.PermissionState.Denied: AN_Logger.Log("READ_CONTACTS Permission Denied"); break; } bool res = AN_PermissionsManager.ShouldShowRequestPermissionRationale(AMM_ManifestPermission.READ_CONTACTS); AN_Logger.Log("ShouldShowRequestPermissionRationale: " + res.ToString()); List <AMM_ManifestPermission> permissions = new List <AMM_ManifestPermission>(); permissions.Add(AMM_ManifestPermission.READ_CONTACTS); permissions.Add(AMM_ManifestPermission.WRITE_CONTACTS); AN_PermissionsManager.RequestPermissions(permissions.ToArray(), (result) => { foreach (var responce in result.GrantResults) { AN_Logger.Log("RequestPermissions: " + responce.Permission.ToString() + " / " + responce.GrantResult.ToString()); } SetResult(SA_TestResult.OK); }); }
private void PrintSignedPlayerInfo() { AN_PlayersClient client = AN_Games.GetPlayersClient(); client.GetCurrentPlayer((result) => { if (result.IsSucceeded) { AN_Player player = result.Data; //Printing player info: AN_Logger.Log("player.Id: " + player.PlayerId); AN_Logger.Log("player.DisplayName: " + player.DisplayName); AN_Logger.Log("player.HiResImageUri: " + player.HiResImageUri); AN_Logger.Log("player.IconImageUri: " + player.IconImageUri); AN_Logger.Log("player.HasIconImage: " + player.HasIconImage); AN_Logger.Log("player.HasHiResImage: " + player.HasHiResImage); if (!player.HasHiResImage) { var url = player.HiResImageUri; AN_ImageManager manager = new AN_ImageManager(); manager.LoadImage(url, (imaheLoadResult) => { }); } } else { AN_Logger.Log("Failed to load Current Player " + result.Error.FullMessage); } }); }
private void RetrivePlayer(Action <SA_Result> callback) { AN_Logger.Log("UM_AndroidSignInClient, cleint sigined-in, getting the player info"); //When Sign in is finished with successes var gamesClient = AN_Games.GetGamesClient(); gamesClient.SetViewForPopups(AN_MainActivity.Instance); //optionally gamesClient.SetGravityForPopups(AN_Gravity.TOP | AN_Gravity.CENTER_HORIZONTAL); AN_PlayersClient client = AN_Games.GetPlayersClient(); SA_Result apiResult; client.GetCurrentPlayer((result) => { if (result.IsSucceeded) { apiResult = new SA_Result(); AN_Logger.Log("UM_AndroidSignInClient, player info retrived, OnPlayerChnaged event will be sent"); UpdatePlayerInfo(result.Data); } else { apiResult = new SA_Result(result.Error); } AN_Logger.Log("UM_AndroidSignInClient, sending sing in result"); callback.Invoke(apiResult); }); }
private static List <string> ReadDependencies() { var result = new List <string>(); try { if (SA_AssetDatabase.IsFileExists(AN_Settings.DEPENDENCIES_FILE_PATH)) { var doc = new XmlDocument(); doc.Load(SA_PathUtil.ConvertRelativeToAbsolutePath(AN_Settings.DEPENDENCIES_FILE_PATH)); var xnList = doc.SelectNodes("dependencies/androidPackages/androidPackage"); foreach (XmlNode xn in xnList) { var spec = xn.Attributes["spec"].Value; result.Add(spec); } } } catch (Exception ex) { AN_Logger.LogError("Error reading AN_Dependencies"); AN_Logger.LogError(AN_Settings.DEPENDENCIES_FILE_PATH + " filed: " + ex.Message); } return(result); }
private void PrintLeaderboardsInfo(List <AN_Leaderboard> leaderboards) { foreach (var leaderboard in leaderboards) { AN_Logger.Log("------------------------------------------------"); AN_Logger.Log("leaderboard.LeaderboardId: " + leaderboard.LeaderboardId); AN_Logger.Log("leaderboard.Description: " + leaderboard.DisplayName); AN_Logger.Log("leaderboard.Name: " + leaderboard.IconImageUri); AN_Logger.Log("leaderboard.UnlockedImageUri: " + leaderboard.LeaderboardScoreOrder); AN_Logger.Log("leaderboard.Variants.Count: " + leaderboard.Variants.Count); foreach (var variant in leaderboard.Variants) { AN_Logger.Log("***************************"); AN_Logger.Log("variant.Collection: " + variant.Collection); AN_Logger.Log("variant.DisplayPlayerRank: " + variant.DisplayPlayerRank); AN_Logger.Log("variant.DisplayPlayerScore: " + variant.DisplayPlayerScore); AN_Logger.Log("variant.NumScores: " + variant.NumScores); AN_Logger.Log("variant.PlayerRank: " + variant.PlayerRank); AN_Logger.Log("variant.PlayerScoreTag: " + variant.PlayerScoreTag); AN_Logger.Log("variant.RawPlayerScore: " + variant.RawPlayerScore); AN_Logger.Log("variant.TimeSpan: " + variant.TimeSpan); AN_Logger.Log("variant.HasPlayerInfo: " + variant.HasPlayerInfo); } } AN_Logger.Log("------------------------------------------------"); }
private void PrintChannelInfo(AN_NotificationChannel channel) { AN_Logger.Log("channel.Id: " + channel.Id); AN_Logger.Log("channel.Name: " + channel.Name); AN_Logger.Log("channel.Description: " + channel.Description); AN_Logger.Log("channel.Importance: " + channel.Importance); }
protected override void TestLeaderboard(AN_Leaderboard leaderboard, AN_LeaderboardsClient client) { foreach (var variant in leaderboard.Variants) { if (variant.Collection == AN_Leaderboard.Collection.Public && variant.TimeSpan == AN_Leaderboard.TimeSpan.AllTime) { long score = variant.RawPlayerScore; score++; client.SubmitScoreImmediate(leaderboard.LeaderboardId, score, "Test_tag", (submitResult) => { if (submitResult.IsSucceeded) { var scoreSubmissionData = submitResult.Data; AN_Logger.Log("SubmitScoreImmediate completed"); AN_Logger.Log("scoreSubmissionData.PlayerId: " + scoreSubmissionData.PlayerId); AN_Logger.Log("scoreSubmissionData.LeaderboardId: " + scoreSubmissionData.LeaderboardId); foreach (AN_Leaderboard.TimeSpan span in (AN_Leaderboard.TimeSpan[])System.Enum.GetValues(typeof(AN_Leaderboard.TimeSpan))) { var scoreSubmissionResult = scoreSubmissionData.GetScoreResult(span); AN_Logger.Log("scoreSubmissionData.FormattedScore: " + scoreSubmissionResult.FormattedScore); AN_Logger.Log("scoreSubmissionData.NewBest: " + scoreSubmissionResult.NewBest); AN_Logger.Log("scoreSubmissionData.RawScore: " + scoreSubmissionResult.RawScore); AN_Logger.Log("scoreSubmissionData.ScoreTag: " + scoreSubmissionResult.ScoreTag); } } SetAPIResult(submitResult); }); return; } } }
private static string GetJarResolverVersion(string assetPath, string SDKName) { string version = SA_PathUtil.GetFileNameWithoutExtension(assetPath); if (version.Contains(SDKName)) { try { version = version.Remove(0, SDKName.Length); if (version.Length > 0 && version[0].Equals('_')) { version = version.Remove(0, 1); } return(version); } catch (Exception ex) { AN_Logger.LogError(string.Format("Error at getting Jar Resolver version - {0}", ex.Message)); return(null); } } else { return(null); } }
public override void Test() { var client = AN_Games.GetAchievementsClient(); client.Load(false, (result) => { if (result.IsSucceeded) { AN_Logger.Log("Load Achievements Succeeded, count: " + result.Achievements.Count); foreach (var achievement in result.Achievements) { AN_Logger.Log("------------------------------------------------"); AN_Logger.Log("achievement.AchievementId: " + achievement.AchievementId); AN_Logger.Log("achievement.Description: " + achievement.Description); AN_Logger.Log("achievement.Name: " + achievement.Name); AN_Logger.Log("achievement.UnlockedImageUri: " + achievement.UnlockedImageUri); AN_Logger.Log("achievement.CurrentSteps: " + achievement.CurrentSteps); AN_Logger.Log("achievement.TotalSteps: " + achievement.TotalSteps); AN_Logger.Log("achievement.Type: " + achievement.Type); AN_Logger.Log("achievement.Sate: " + achievement.State); } AN_Logger.Log("------------------------------------------------"); SetResult(SA_TestResult.OK); } else { SetAPIResult(result); } }); }
private void SignInNoSilent() { AN_GoogleSignInOptions.Builder builder = new AN_GoogleSignInOptions.Builder(AN_GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN); builder.RequestId(); builder.RequestEmail(); builder.RequestProfile(); AN_GoogleSignInOptions gso = builder.Build(); AN_GoogleSignInClient client = AN_GoogleSignIn.GetClient(gso); AN_Logger.Log("SignInNoSilent Start "); client.SignIn((signInResult) => { AN_Logger.Log("Sign In StatusCode: " + signInResult.StatusCode); if (signInResult.IsSucceeded) { AN_Logger.Log("SignIn Succeeded"); UpdateUIWithAccount(signInResult.Account); } else { AN_Logger.Log("SignIn filed: " + signInResult.Error.FullMessage); } }); }
public override void Test() { var client = AN_Games.GetSnapshotsClient(); client.Load((result) => { if (result.IsSucceeded) { if (result.Snapshots.Count == 0) { SetResult(SA_TestResult.WithError("There are no spanpshot's. Can't test delete action")); return; } AN_SnapshotMetadata meta = result.Snapshots[0]; client.Delete(meta, (deleteResult) => { if (deleteResult.IsSucceeded) { AN_Logger.Log("deleteResult.SnapshotId: " + deleteResult.SnapshotId); } SetAPIResult(deleteResult); }); } else { SetAPIResult(result); } }); }
public void GetAvatar(Action <Texture2D> callback) { if (m_avatar != null) { callback.Invoke(m_avatar); return; } if (!m_anPlayer.HasHiResImage) { callback.Invoke(null); return; } var url = m_anPlayer.HiResImageUri; AN_ImageManager manager = new AN_ImageManager(); AN_Logger.Log("TrYING TO LOAD AN IMAGE"); manager.LoadImage(url, (result) => { if (result.IsSucceeded) { callback.Invoke(result.Image); } else { callback.Invoke(null); } }); }
//-------------------------------------- // Public Methods //-------------------------------------- public void Share(Action callback = null) { if (Application.isEditor) { SA_Coroutine.WaitForSeconds(1, () => { if (callback != null) { callback.Invoke(); } }); return; } AN_PermissionsUtility.TryToResolvePermission(new [] { AMM_ManifestPermission.WRITE_EXTERNAL_STORAGE, AMM_ManifestPermission.READ_EXTERNAL_STORAGE }, (granted) => { if (!granted) { AN_Logger.LogError("User haven't granted required sharing permissions: " + "WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE. " + "Sharing may not be fully completed."); } ShowSharingDialog(callback); }); }
protected AN_Intent GenerateChooserIntent(string title, params string[] filters) { if (filters.Length == 0) { return(AN_Intent.CreateChooser(ShareIntent, title)); } //Simple intent to get list of the apps that can support the send action var testIntent = new AN_Intent(); testIntent.SetAction(AN_Intent.ACTION_SEND); testIntent.SetType("text/plain"); var pm = AN_MainActivity.Instance.GetPackageManager(); var resolveInfoList = pm.QueryIntentActivities(testIntent); var intentShareList = new List <AN_Intent>(); foreach (var resInfo in resolveInfoList) { var packageName = resInfo.ActivityInfo.PackageName; foreach (var filterPattern in filters) { if (resInfo.ActivityInfo.PackageName.ToLower().Contains(filterPattern) || resInfo.ActivityInfo.Name.ToLower().Contains(filterPattern)) { //TODO do we need full data or only package name var intent = new AN_Intent(ShareIntent); intent.SetPackage(packageName); intentShareList.Add(intent); break; } } } if (intentShareList.Count == 0) { //we can't find packages for a provided filters, so we will use standard chooser string filterList = ""; foreach (var f in filters) { filterList += f + ";"; } AN_Logger.Log("Wasn't able to find packages for filters: " + filterList); return(AN_Intent.CreateChooser(ShareIntent, title)); } else { AN_Logger.Log("Chooser created with options count: " + intentShareList.Count); //if we have only 1 option there is no point to create hole chooser UI. Let's just use this option if (intentShareList.Count == 1) { return(intentShareList[0]); } return(AN_Intent.CreateChooser(ShareIntent, title, intentShareList.ToArray())); } }
public override void Test() { AN_LicenseChecker.CheckAccess((result) => { //We may fail with licence check, it's okay as long as PolicyCode is prsed corretly. AN_Logger.Log("result.PolicyCode: " + result.PolicyCode); SetResult(SA_TestResult.OK); }); }
private void ReadAndWrite(string name) { var client = AN_Games.GetSnapshotsClient(); client.Open(name, m_createIfNotFound, m_conflictPolicy, (result) => { if (result.IsSucceeded) { AN_Logger.Log("We have snapshot, reading data..."); AN_Snapshot snapshot = result.Data.GetSnapshot(); byte[] data = snapshot.ReadFully(); var meta = snapshot.GetMetadata(); m_progress = meta.ProgressValue + 10; m_playedTime = meta.PlayedTime + 100; string base64Text = Convert.ToBase64String(data); AN_Logger.Log("Snapshot data: " + base64Text); PrintSnapshotMetadata(snapshot.GetMetadata()); AN_Logger.Log("Writing data..."); m_snpashotData = "My game data " + name; data = m_snpashotData.ToBytes(); snapshot.WriteBytes(data); SA_ScreenUtil.TakeScreenshot(512, (screenshot) => { var changeBuilder = new AN_SnapshotMetadataChange.Builder(); changeBuilder.SetDescription("Hello Description"); changeBuilder.SetPlayedTimeMillis(m_playedTime); changeBuilder.SetProgressValue(m_progress); changeBuilder.SetCoverImage(screenshot); AN_SnapshotMetadataChange changes = changeBuilder.Build(); client.CommitAndClose(snapshot, changes, (commitResult) => { if (commitResult.IsSucceeded) { PrintSnapshotMetadata(commitResult.Metadata); VerifySnapshotsSave(name); } else { SetAPIResult(result); } }); }); } else { SetAPIResult(result); } }); }
private void PrintInfo(AN_GoogleSignInAccount account) { AN_Logger.Log("account.GetDisplayName: " + account.GetId()); AN_Logger.Log("account.GetDisplayName: " + account.GetDisplayName()); AN_Logger.Log("account.GetGivenName: " + account.GetGivenName()); AN_Logger.Log("account.GetEmail: " + account.GetEmail()); AN_Logger.Log("account.GetServerAuthCode: " + account.GetServerAuthCode()); SetResult(SA_TestResult.OK); }
//-------------------------------------- // AN_iBillingClientStateListener //-------------------------------------- public void OnBillingSetupFinished(SA_iResult billingResult) { if (billingResult.IsSucceeded) { m_IsConnected = true; AN_Logger.Log("Service Connected"); return; } }
private void StartSingInFlowInternal(Action <SA_Result> callback) { AN_Logger.Log("UM_AndroidSignInClient, starting silent sing-in"); SignInClient.SilentSignIn(silentSignInResult => { if (silentSignInResult.IsSucceeded) { AN_Logger.Log("UM_AndroidSignInClient, silent sing-in Succeeded"); RetrievePlayer(callback); } else { AN_Logger.Log("UM_AndroidSignInClient, silent sing-in Failed"); AN_Logger.Log("UM_AndroidSignInClient, starting interactive sing-in"); SignInClient.SignIn(interactiveSignInResult => { AN_Logger.Log("UM_AndroidSignInClient, interactive sing-in completed"); if (interactiveSignInResult.IsSucceeded) { AN_Logger.Log("UM_AndroidSignInClient, interactive sing-in succeeded"); RetrievePlayer(callback); } else { AN_Logger.Log("UM_AndroidSignInClient, interactive sing-in failed"); var errorCode = interactiveSignInResult.Error.Code; switch (errorCode) { //Retry may solve the issue case (int)AN_CommonStatusCodes.NETWORK_ERROR: case (int)AN_GoogleSignInStatusCodes.SIGN_IN_CURRENTLY_IN_PROGRESS: m_ResolvedErrors.Add(errorCode); //Let's see if we tried to do it before if (m_ResolvedErrors.Contains(errorCode)) { AN_Logger.Log("UM_AndroidSignInClient, sending fail result"); callback.Invoke(new SA_Result(interactiveSignInResult.Error)); } else { //Nope, this is new one, let's try to resolve it AN_Logger.Log("Trying to resolved failed sigin-in result with code: " + errorCode); StartSingInFlowInternal(callback); } break; default: AN_Logger.Log("UM_AndroidSignInClient, sending fail result"); callback.Invoke(new SA_Result(interactiveSignInResult.Error)); break; } } }); } }); }
private void StartSingInFlowternal(Action <SA_Result> callback) { AN_Logger.Log("UM_AndroidSignInClient, starting siglent sing-in"); SignInClient.SilentSignIn((silentSignInResult) => { if (silentSignInResult.IsSucceeded) { AN_Logger.Log("UM_AndroidSignInClient, siglent sing-in Succeeded"); RetrivePlayer(callback); } else { AN_Logger.Log("UM_AndroidSignInClient, siglent sing-in Failed"); AN_Logger.Log("UM_AndroidSignInClient, starting interactive sing-in"); SignInClient.SignIn((interactiveSignInResult) => { AN_Logger.Log("UM_AndroidSignInClient, interactive sing-in completed"); if (interactiveSignInResult.IsSucceeded) { AN_Logger.Log("UM_AndroidSignInClient, interactive sing-in succeeded"); RetrivePlayer(callback); } else { AN_Logger.Log("UM_AndroidSignInClient, interactive sing-in failed"); int errorCode = interactiveSignInResult.Error.Code; switch (errorCode) { //Retry may solve the issue case (int)AN_CommonStatusCodes.NETWORK_ERROR: //in some cases it may cause a loop //case (int)AN_CommonStatusCodes.INTERNAL_ERROR: case (int)AN_CommonStatusCodes.FAILED_ACTIVITY_ERROR: //Let's see if we tried to do it before if (m_resolvedErrors.Contains(errorCode)) { AN_Logger.Log("UM_AndroidSignInClient, sending fail result"); callback.Invoke(new SA_Result(interactiveSignInResult.Error)); } else { //Nope, this is new one, let's try to resolve it AN_Logger.Log("Trying to resolved failed sigin-in result with code: " + errorCode); StartSingInFlowternal(callback); } break; default: AN_Logger.Log("UM_AndroidSignInClient, sending fail result"); callback.Invoke(new SA_Result(interactiveSignInResult.Error)); break; } } }); } }); }
private void PrintMeta(AN_SnapshotMetadata meta) { AN_Logger.Log("------------------------------------------------"); AN_Logger.Log("meta.CoverImageUri: " + meta.CoverImageUri); AN_Logger.Log("meta.Title: " + meta.Title); AN_Logger.Log("meta.Description: " + meta.Description); AN_Logger.Log("meta.DeviceName: " + meta.DeviceName); AN_Logger.Log("meta.PlayedTime: " + meta.PlayedTime); AN_Logger.Log("meta.ProgressValue: " + meta.ProgressValue); }
public override void Test() { AN_Billing.Connect((result) => { AN_Logger.Log("Connect result.IsSucceeded: " + result.IsSucceeded); AN_Logger.Log("Connect result.IsInAppsAPIAvalible: " + result.IsInAppsAPIAvalible); AN_Logger.Log("Connect result.IsSubsAPIAvalible: " + result.IsSubsAPIAvalible); if (result.IsSucceeded) { AN_Logger.Log("AN_Billing.Inventory.Purchases.Count: " + AN_Billing.Inventory.Purchases.Count); AN_Logger.Log("AN_Billing.Inventory.Products.Count: " + AN_Billing.Inventory.Products.Count); //Let's print all purchases info foreach (AN_Purchase purchase in AN_Billing.Inventory.Purchases) { AN_Logger.Log("purchase.OrderId " + purchase.OrderId); AN_Logger.Log("purchase.ProductId " + purchase.ProductId); AN_Logger.Log("purchase.PackageName " + purchase.PackageName); AN_Logger.Log("purchase.PurchaseState " + purchase.PurchaseState); AN_Logger.Log("purchase.PurchaseTime " + purchase.PurchaseTime); AN_Logger.Log("purchase.Signature " + purchase.Signature); AN_Logger.Log("purchase.Token " + purchase.Token); AN_Logger.Log("purchase.Type " + purchase.Type); AN_Logger.Log("purchase.DeveloperPayload " + purchase.DeveloperPayload); AN_Logger.Log("purchase.AutoRenewing " + purchase.AutoRenewing); AN_Logger.Log("purchase.OriginalJson " + purchase.OriginalJson); AN_Logger.Log("----------------------------------------------------"); } //And products info as well foreach (AN_Product product in AN_Billing.Inventory.Products) { AN_Logger.Log("product.ProductId " + product.ProductId); AN_Logger.Log("product.Type " + product.Type); AN_Logger.Log("product.Price " + product.Price); AN_Logger.Log("product.Title " + product.Title); AN_Logger.Log("product.Description " + product.Description); AN_Logger.Log("product.PriceAmountMicros " + product.PriceAmountMicros); AN_Logger.Log("product.PriceCurrencyCode " + product.PriceCurrencyCode); AN_Logger.Log("product.SubscriptionPeriod " + product.SubscriptionPeriod); AN_Logger.Log("product.FreeTrialPeriod " + product.FreeTrialPeriod); AN_Logger.Log("product.SubscriptionPeriod " + product.SubscriptionPeriod); AN_Logger.Log("product.FreeTrialPeriod " + product.FreeTrialPeriod); AN_Logger.Log("product.IntroductoryPrice " + product.IntroductoryPrice); AN_Logger.Log("product.IntroductoryPriceAmountMicros " + product.IntroductoryPriceAmountMicros); AN_Logger.Log("product.IntroductoryPricePeriod " + product.IntroductoryPricePeriod); AN_Logger.Log("product.IntroductoryPriceCycles " + product.IntroductoryPriceCycles); AN_Logger.Log("product.OriginalJson " + product.OriginalJson); AN_Logger.Log("----------------------------------------------------"); } } SetAPIResult(result); }); }
public override void Test() { //Package Info string packageName = UnityEngine.Application.identifier; var pm = AN_MainActivity.Instance.GetPackageManager(); AN_PackageInfo packageInfo = pm.GetPackageInfo(packageName, 0); AN_Logger.Log("packageInfo.VersionName: " + packageInfo.VersionName); AN_Logger.Log("packageInfo.PackageName: " + packageInfo.PackageName); AN_Logger.Log("packageInfo.SharedUserId: " + packageInfo.SharedUserId); //Query Intent Activities TEST //Simple intent to get list of the apps that can support the send action AN_Intent testIntent = new AN_Intent(); testIntent.SetAction(AN_Intent.ACTION_SEND); testIntent.SetType("text/plain"); List <AN_ResolveInfo> resolveInfoList = pm.QueryIntentActivities(testIntent, 0); foreach (var resolveInfo in resolveInfoList) { AN_Logger.Log("resolveInfo.ActivityInfo.Name: " + resolveInfo.ActivityInfo.Name); AN_Logger.Log("resolveInfo.ActivityInfo.PackageName: " + resolveInfo.ActivityInfo.PackageName); } ///Open External App AN_Intent startAppIntent = pm.GetLaunchIntentForPackage("com.facebook.katana"); if (startAppIntent == null) { SetResult(SA_TestResult.WithError("App with Id: com.facebook.katana not found on device")); return; } startAppIntent.AddCategory(AN_Intent.CATEGORY_LAUNCHER); /* * AN_ProxyActivity proxy = new AN_ProxyActivity(); * bool started = proxy.StartActivityForResult(startAppIntent, (result) => { * SetResult(TestResult.OK); * proxy.Finish(); * }); * * if(!started) { * SetResult(TestResult.GetError("Failed to create activity")); * }*/ SetResult(SA_TestResult.OK); }
private void UpdateUIWithAccount(AN_GoogleSignInAccount account) { AN_Logger.Log("account.HashCode:" + account.HashCode); AN_Logger.Log(account); AN_Logger.Log("SignIn IsSucceeded. user: " + account.GetDisplayName()); //Display User info PrintSignedPlayerInfo(); }
protected void SilentSignIn(Action <AN_GoogleSignInResult> result) { AN_Logger.Log("Let's try Silent SignIn first"); SignInClient.SilentSignIn((signInResult) => { if (signInResult.IsSucceeded) { PrintInfo(signInResult.Account); } result.Invoke(signInResult); }); }
public static void Log(object message) { if (Application.platform == RuntimePlatform.Android) { AN_Logger.Log(message); } else { ISN_Logger.Log(message); } }
public override void Test() { SA_ScreenUtil.TakeScreenshot((screenshot) => { AN_Gallery.SaveImageToGallery(screenshot, "Example Scnee", (result) => { if (result.IsSucceeded) { AN_Logger.Log("Screenshot has been saved to: " + result.Path); } SetAPIResult(result); }); }); }
protected void InteractiveSignIn(Action <AN_GoogleSignInResult> result) { AN_Logger.Log("Starting the Interactive Sign in flow"); SignInClient.SignIn((signInResult) => { AN_Logger.Log("Sign In StatusCode: " + signInResult.StatusCode); if (signInResult.IsSucceeded) { PrintInfo(signInResult.Account); } result.Invoke(signInResult); }); }
protected void PrintScoresResultData(AN_LinkedObjectResult <AN_LeaderboardScores> result) { var scores = result.Data; var buffer = scores.Scores; AN_Logger.Log("scores.Leaderboard.DisplayName: " + scores.Leaderboard.DisplayName); AN_Logger.Log("Loaded scores Count: " + buffer.Scores.Count); foreach (var score in buffer.Scores) { PrintScoreInfo(score); } }
private void PrintPurchaseInfo(AN_Purchase purchase) { AN_Logger.Log("purchase.Sku: " + purchase.Sku); AN_Logger.Log("purchase.Type: " + purchase.Type); AN_Logger.Log("purchase.PurchaseToken: " + purchase.PurchaseToken); AN_Logger.Log("purchase.IsAcknowledged: " + purchase.IsAcknowledged); AN_Logger.Log("purchase.IsAutoRenewing: " + purchase.IsAutoRenewing); AN_Logger.Log("purchase.Signature: " + purchase.Signature); AN_Logger.Log("purchase.OrderId: " + purchase.OrderId); AN_Logger.Log("purchase.PackageName: " + purchase.PackageName); AN_Logger.Log("purchase.PurchaseState: " + purchase.PurchaseState); AN_Logger.Log("purchase.DeveloperPayload: " + purchase.DeveloperPayload); }