Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End of Year: generate image and share it through Share Sheet #404

Merged
merged 11 commits into from
Oct 19, 2022

Conversation

leandroalonso
Copy link
Member

📘 Project: #376

Includes the logic for image generation based on the SwiftUI story View and passes the image to the Share Sheet.

Additional details

The image generation needs to happen on the main thread — so I had to come up with a way to generate the image without affecting the presentation of the Share Sheet. If we generate the image right before the Share Sheet is presented the UI hands for a few milliseconds.

I postponed this process to right after the Share Sheet is presented. If we want to also share directly to Instagram/Facebook this process will need to apply to them too, but I'll leave that for later.

To test

I recommend testing that on a real device because on Simulator the image generation is quite quick and almost doesn't affect the main thread.

  1. Enable the endOfYear flag in FeatureFlag.swift
  2. Run the app
  3. When the prompt appears, tap "View My 2022"
  4. Tap "Share"
  5. Tap Save Image
  6. Go to Photos
  7. ✅ Make sure the generated image is correct ¶
  8. Go back to the app, and share the story again
  9. Select Instagram or Facebook (story)
  10. ✅ Check that the image appears correctly in those apps

¶ You'll notice that the generated image is slightly different from the presented Story. I'll leave those tweaks for when we'll work on the final designs.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@leandroalonso leandroalonso added the [Project] End of Year 2023 End of Year project label Oct 18, 2022
@leandroalonso leandroalonso added this to the Future milestone Oct 18, 2022
@leandroalonso leandroalonso requested a review from a team as a code owner October 18, 2022 15:03
@leandroalonso leandroalonso changed the base branch from trunk to task/376-create-dummy-story October 18, 2022 15:04
@leandroalonso leandroalonso mentioned this pull request Oct 18, 2022
36 tasks
@leandroalonso leandroalonso changed the title End of Year: generate the image and share it through a Share Sheet End of Year: generate image and share it through Share Sheet Oct 18, 2022
Base automatically changed from task/376-create-dummy-story to trunk October 18, 2022 16:27
@chipsnyder chipsnyder assigned chipsnyder and unassigned chipsnyder Oct 18, 2022
Copy link
Contributor

@chipsnyder chipsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Looks good and the photo path works as expected.

Select Instagram or Facebook (story)

I don't have Instagram or Facebook set up on my test device so I wasn't able to check these paths.

@leandroalonso leandroalonso merged commit 5327fd7 into trunk Oct 19, 2022
@leandroalonso leandroalonso deleted the task/376-convert-story-to-image branch October 19, 2022 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Project] End of Year 2023 End of Year project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants