Exemplo n.º 1
0
        private async void UpdateDistributeEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
        {
            await Distribute.SetEnabledAsync(e.IsChecked);

            DistributeEnabledSwitch.Checked = await Distribute.IsEnabledAsync();
        }
 // Before
 public DistributeUpdateTest()
 {
     Utils.DeleteDatabase();
     Distribute.UnsetInstance();
     DistributeEvent?.Invoke(this, DistributeTestType.Clear);
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get the ViewPager and set it's PagerAdapter so that it can display items
            var viewPager = FindViewById(Resource.Id.viewpager) as ViewPager;

            viewPager.Adapter = new PagerAdapter(SupportFragmentManager, this);

            // Give the TabLayout the ViewPager
            var tabLayout = FindViewById(Resource.Id.tablayout) as TabLayout;

            tabLayout.SetupWithViewPager(viewPager);

            // App Center integration
            AppCenterLog.Assert(LogTag, "AppCenter.LogLevel=" + AppCenter.LogLevel);
            AppCenter.LogLevel = LogLevel.Verbose;
            AppCenterLog.Info(LogTag, "AppCenter.LogLevel=" + AppCenter.LogLevel);
            AppCenterLog.Info(LogTag, "AppCenter.Configured=" + AppCenter.Configured);

            // Set event handlers
            Crashes.SendingErrorReport      += SendingErrorReportHandler;
            Crashes.SentErrorReport         += SentErrorReportHandler;
            Crashes.FailedToSendErrorReport += FailedToSendErrorReportHandler;

            // Set callbacks
            Crashes.ShouldProcessErrorReport    = ShouldProcess;
            Crashes.ShouldAwaitUserConfirmation = ConfirmationHandler;

            Distribute.ReleaseAvailable = OnReleaseAvailable;
            AppCenterLog.Assert(LogTag, "AppCenter.Configured=" + AppCenter.Configured);
            AppCenter.SetLogUrl("https://in-integration.dev.avalanch.es");
            Distribute.SetInstallUrl("https://install.portal-server-core-integration.dev.avalanch.es");
            Distribute.SetApiUrl("https://asgard-int.trafficmanager.net/api/v0.1");

            // Enable Firebase Analytics if set
            var enableAnalytics = Preferences.SharedPreferences.GetBoolean(Constants.FirebaseAnalyticsEnabledKey, false);

            if (enableAnalytics)
            {
                Push.EnableFirebaseAnalytics();
            }

            Push.PushNotificationReceived += PrintNotification;

            AppCenter.Start("bff0949b-7970-439d-9745-92cdc59b10fe", typeof(Analytics), typeof(Crashes),
                            typeof(Push), typeof(Distribute));

            AppCenter.IsEnabledAsync().ContinueWith(enabled =>
            {
                AppCenterLog.Info(LogTag, "AppCenter.Enabled=" + enabled.Result);
            });
            AppCenter.GetInstallIdAsync().ContinueWith(installId =>
            {
                AppCenterLog.Info(LogTag, "AppCenter.InstallId=" + installId.Result);
            });
            Crashes.HasCrashedInLastSessionAsync().ContinueWith(hasCrashed =>
            {
                AppCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + hasCrashed.Result);
            });
            Crashes.GetLastSessionCrashReportAsync().ContinueWith(report =>
            {
                AppCenterLog.Info(LogTag, "Crashes.LastSessionCrashReport.Exception=" + report.Result?.Exception);
                AppCenterLog.Info(LogTag, "Crashes.LastSessionCrashReport.Throwable=" + report.Result?.AndroidDetails?.Throwable);
            });
        }
 async void UpdateDistributeEnabled(object sender, ToggledEventArgs e)
 {
     await Distribute.SetEnabledAsync(e.Value);
 }
Exemplo n.º 5
0
        public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
        {
            Distribute.OpenUrl(url);

            return(true);
        }
Exemplo n.º 6
0
 partial void UpdateEnabled()
 {
     Distribute.SetEnabledAsync(DistributeEnabledSwitch.On).Wait();
     DistributeEnabledSwitch.On = Distribute.IsEnabledAsync().Result;
 }
        protected override void OnStart()
        {
            if (!AppCenter.Configured)
            {
                AppCenterLog.Assert(LogTag, "AppCenter.LogLevel=" + AppCenter.LogLevel);
                AppCenter.LogLevel = LogLevel.Verbose;
                AppCenterLog.Info(LogTag, "AppCenter.LogLevel=" + AppCenter.LogLevel);
                AppCenterLog.Info(LogTag, "AppCenter.Configured=" + AppCenter.Configured);

                // Set callbacks
                Crashes.ShouldProcessErrorReport    = ShouldProcess;
                Crashes.ShouldAwaitUserConfirmation = ConfirmationHandler;
                Crashes.GetErrorAttachments         = GetErrorAttachmentsCallback;
                Distribute.ReleaseAvailable         = OnReleaseAvailable;
                Distribute.WillExitApp        = OnWillExitApp;
                Distribute.NoReleaseAvailable = OnNoReleaseAvailable;

                // Event handlers
                Crashes.SendingErrorReport      += SendingErrorReportHandler;
                Crashes.SentErrorReport         += SentErrorReportHandler;
                Crashes.FailedToSendErrorReport += FailedToSendErrorReportHandler;

                AppCenterLog.Assert(LogTag, "AppCenter.Configured=" + AppCenter.Configured);

                var updateTrack = TrackUpdateUtils.GetPersistedUpdateTrack();
                if (updateTrack != null)
                {
                    Distribute.UpdateTrack = updateTrack.Value;
                }
                if (Current.Properties.TryGetValue(Constants.AutomaticUpdateCheckKey, out object persistedObject) && !(bool)persistedObject)
                {
                    Distribute.DisableAutomaticCheckForUpdate();
                }
                if (Current.Properties.ContainsKey(Constants.StorageMaxSize) && Current.Properties[Constants.StorageMaxSize] is long size)
                {
                    AppCenter.SetMaxStorageSizeAsync(size);
                }
                AppCenter.Start(GetTokensString(), typeof(Analytics), typeof(Crashes), typeof(Distribute));
                if (Current.Properties.ContainsKey(Constants.UserId) && Current.Properties[Constants.UserId] is string id)
                {
                    AppCenter.SetUserId(id);
                }
                AppCenter.IsEnabledAsync().ContinueWith(enabled =>
                {
                    AppCenterLog.Info(LogTag, "AppCenter.Enabled=" + enabled.Result);
                });
                AppCenter.GetInstallIdAsync().ContinueWith(installId =>
                {
                    AppCenterLog.Info(LogTag, "AppCenter.InstallId=" + installId.Result);
                });
                AppCenterLog.Info(LogTag, "AppCenter.SdkVersion=" + AppCenter.SdkVersion);
                Crashes.HasCrashedInLastSessionAsync().ContinueWith(hasCrashed =>
                {
                    AppCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + hasCrashed.Result);
                });
                Crashes.GetLastSessionCrashReportAsync().ContinueWith(task =>
                {
                    AppCenterLog.Info(LogTag, "Crashes.LastSessionCrashReport.StackTrace=" + task.Result?.StackTrace);
                });
            }
        }
Exemplo n.º 8
0
 public int AddDistribute(Distribute entity)
 {
     return(dal.AddEntity(entity));
 }
Exemplo n.º 9
0
 public override void ViewDidAppear(bool animated)
 {
     base.ViewDidAppear(animated);
     DistributeEnabledSwitch.On      = Distribute.IsEnabledAsync().Result;
     DistributeEnabledSwitch.Enabled = AppCenter.IsEnabledAsync().Result;
 }
Exemplo n.º 10
0
        /// <summary>
        /// Raises the <see cref="NavigatedTo"/> event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="NavigatedToEventArgs"/> instance containing the event data.
        /// </param>
        /// <param name="viewModelState">
        /// State of the view ViewModel.
        /// </param>
        /// <returns>
        /// A <see cref="Task"/> representing the asynchronous operation.
        /// </returns>
        public override async Task <bool> PopulateViewModelAsync()
        {
            // cache Header Data record
            HeaderData = DV.HeaderDV.HeaderDataModel.HLink;

            // Assembly level stuff
            var assembly     = GetType().GetTypeInfo().Assembly;
            var assemblyName = new AssemblyName(assembly.FullName);

            CardListLineCollection t = new CardListLineCollection
            {
                new CardListLine("Application Name", AppInfo.Name),

                new CardListLine("Package Name", AppInfo.PackageName),

                new CardListLine("First Launch Ever?", VersionTracking.IsFirstLaunchEver),

                new CardListLine("First Launch Current Version?", VersionTracking.IsFirstLaunchForCurrentVersion),

                new CardListLine("First Launch Current Build?", VersionTracking.IsFirstLaunchForCurrentBuild),

                new CardListLine("Current Version", VersionTracking.CurrentVersion),

                new CardListLine("Current Build", VersionTracking.CurrentBuild),

                new CardListLine("Previous Version", VersionTracking.PreviousVersion),

                new CardListLine("Previous Build", VersionTracking.PreviousBuild),

                new CardListLine("First Version Installed", VersionTracking.FirstInstalledVersion),

                new CardListLine("First Build Installed", VersionTracking.FirstInstalledBuild),

                // // TODO new CardListLine("versionHistory", VersionTracking.VersionHistory),

                // // TODO new CardListLine("buildHistory", VersionTracking.BuildHistory),

                new CardListLine("Major Version", assemblyName.Version.Major),

                new CardListLine("Minor Version", assemblyName.Version.Minor),

                new CardListLine("Major Revision", assemblyName.Version.MajorRevision),

                new CardListLine("Middle Revision", assemblyName.Version.Revision),

                new CardListLine("Minor Revision", assemblyName.Version.MinorRevision),

                new CardListLine("App Center update status", await Distribute.IsEnabledAsync().ConfigureAwait(false)),

                new CardListLine("App Center update track", Distribute.UpdateTrack.ToString()),
            };

            t.Title = "Application Versions";

            ApplicationVersionList = t;       // TODO Ugly -  Trigger SetProperty

            //// Set WhatsNew text Set MarkdownView information that is not easily set in XAML
            //MarkdownTheme tt = new DarkMarkdownTheme
            //{
            //    BackgroundColor = CommonRoutines.ResourceColourGet("CardBackGroundNote")
            //};

            //// Check for updates
            //await Distribute.SetEnabledAsync(true);
            //Distribute.CheckForUpdate();

            return(true);
        }
Exemplo n.º 11
0
    IEnumerator DrawWithAnimation(int drawnPlayer, int cardIndex, int turnPlayer)
    {
        get();
        cardName = "Card" + cardIndex;
        card     = GameObject.Find(cardName);
        moveFlag = true;
        yield return(new WaitForSeconds(0.5f));  //0.5秒待機

        moveFlag = false;
        int deleted = hands.FindDeletedPair(cardIndex, turnPlayer);

        if (deleted != 100)
        {
            flashFlag = true;   //アニメーション最中のアクション無効化用

            cardName = "Card" + deleted;
            card     = GameObject.Find(cardName);
            var color = card.GetComponent <SpriteRenderer>().color;
            color.a = 0;
            card.GetComponent <SpriteRenderer>().color = color;
            yield return(new WaitForSeconds(0.2f));

            color.a = 1f;
            card.GetComponent <SpriteRenderer>().color = color;
            yield return(new WaitForSeconds(0.2f));

            color.a = 0;
            card.GetComponent <SpriteRenderer>().color = color;
            yield return(new WaitForSeconds(0.2f));

            color.a = 1f;
            card.GetComponent <SpriteRenderer>().color = color;
            yield return(new WaitForSeconds(1f));

            record.updateRecordPaired(turn + 1, cardIndex, deleted); //棋譜操作
            record.updateInfoPaired(cardIndex, deleted);             //プライベート情報操作
            flashFlag = false;
        }
        else
        {
            record.updateRecordUnpaired(turn + 1, cardIndex, turnPlayer); //棋譜操作
            record.updateInfoUnpaired(turnPlayer, cardIndex);             //プライベート情報操作
        }

        hands.hands[dP].Remove(cardIndex); //引かれる人の手札配列からカードを削除
        hands.hands[tP].Add(cardIndex);    //引いた人の手札配列にカードを追加
        hands.DeletePair((cardIndex % 13) + 1, turnPlayer);
        hands.ClickUpdate();
        distribute = hand.GetComponent <Distribute>();
        distribute.updateField();
        turnManager.NextTurnPlayer();
        turnManager.NextDrawnPlayer();
        turnManager.turnNext(cardIndex);
        int deletedUniform;

        if (deleted == 100)
        {
            deletedUniform = -1;
        }
        else
        {
            deletedUniform = record.Uniform.IndexOf(deleted);
        }
        for (int cn = 0; cn < 3; cn++)
        {
            coms[cn].load(dP, record.Uniform.IndexOf(cardIndex), tP, deletedUniform);
        }
    }
Exemplo n.º 12
0
 public static void CheckForNewVersion() => Distribute.CheckForUpdate();
Exemplo n.º 13
0
 public static async Task <bool> CheckIfUpdateServiceEnabledAsync() =>
 await Distribute.IsEnabledAsync();
Exemplo n.º 14
0
 public static void UpdateAppCenterUpdateChecks(bool inAppUpdateEnabled) =>
 Distribute.SetEnabledAsync(inAppUpdateEnabled);