Ejemplo n.º 1
0
        private async Task SendToGoogle(ImageFormat format)
        {
            using (var imageStream = new MemoryStream())
            {
                ExportService.ExportWithoutSaving(Canvas, format, imageStream);
                string feedback = await GoogleAPI.SaveOnGoogleDrive(imageStream, ".png", AuthService.GoogleAccessToken);

                ToastsService.Pop("Google Drive Sharing", feedback, Constants.DriveIconUri);
                if (AuthService.IsLoggedIn)
                {
                    await AchievementsService.Increment(AuthService.CurrentUser.Id, AchievementMetrics.SharesOnDrive);
                }
            }
        }
Ejemplo n.º 2
0
        private void GetFacebookCaption(MemoryStream image)
        {
            if (CaptionWindow?.IsVisible ?? false)
            {
                return;
            }
            CaptionWindow = new FacebookCaptionView();
            CaptionWindow.CaptionWritten += async(caption) =>
            {
                string feedback = await FacebookAPI.ShareImage(image, AuthService.FacebookAccessToken, caption);

                ToastsService.Pop("Facebook sharing", feedback, Constants.FacebookIconUri);
                if (AuthService.IsLoggedIn)
                {
                    await AchievementsService.Increment(AuthService.CurrentUser.Id, AchievementMetrics.SharesOnFacebook);
                }
            };

            CaptionWindow.Show();
        }