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

Add share note functionality #1477

Merged
merged 8 commits into from
Sep 10, 2024
Merged

Conversation

pelumy
Copy link
Contributor

@pelumy pelumy commented Sep 9, 2024

Issues covered

#1272

Description

This PR adds a share functionality to the share note button option on the confirmation dialogue in the NoteOptionsButton file. The following changes were made:

  • A showingShare state variable was already present, so set it to true when the share note button is pressed.
  • The share sheet was already present, so updated the code block to include sending the note link to the Apple Share sheet.
  • Adds an optional completion handler to the ActivityViewController to perform actions after the share activity is finished.
  • Sets showingShare to false in this completion handler to dismiss the share sheet after the share activity is finished.

How to test

  1. Build the app.
  2. Go to the Feed tab.
  3. Choose any note and select the 3 dots menu at the top right of the note, just beside the time.
  4. Click the share note button option
  5. Please confirm that Apple's share sheet comes up and you can share the note link anywhere.

Screenshots/Video

Screen.Recording.2024-09-09.at.4.09.45.PM.mov

@pelumy
Copy link
Contributor Author

pelumy commented Sep 9, 2024

I'm curious as to why this note link directs the user to an njump website instead of the nos app 🤔

@pelumy pelumy changed the base branch from main to update/dots-note-menu-copy September 10, 2024 12:44
@joshuatbrown
Copy link
Contributor

@pelumy I think the main reason is compatibility -- we don't know the people who receive the link have Nos installed, and since we're using TestFlight right now, it's a little challenging for some people to get it installed. The njump link will work for anyone.

@joshuatbrown joshuatbrown self-assigned this Sep 10, 2024
Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

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

This works perfectly! Weird but cool that we already had the showingShare property and sheet ready for you! Great work!

Nos/Views/Components/ActivityView.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

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

Thanks for the update! Perfect!

Base automatically changed from update/dots-note-menu-copy to main September 10, 2024 16:16
@joshuatbrown joshuatbrown added this pull request to the merge queue Sep 10, 2024
@pelumy pelumy changed the title Feature/share note functionality Add share note functionality Sep 10, 2024
Merged via the queue into main with commit a25c74c Sep 10, 2024
4 checks passed
@joshuatbrown joshuatbrown deleted the feature/share-note-functionality branch September 10, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants