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); } } }
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(); }