Skip to content

Conversation

phil1995
Copy link
Collaborator

Adds the "Get Folder" and "Save File" intents. This allows the user to create various shortcuts / automations in the Shortcuts app, including an automatic photo upload.

The "Get Folder" intent is used as the basis for the "Save File" intent, as this means that a new online check of the specified parent folder does not have to be executed multiple times. This is because at least one online enumeration is required to ensure that this folder is in the FileProviderExtension database. Since the subsequent call of importDocument(at:toParentItemIdentifier) requires the parentItemIdentifier, i.e. the identifier of the specified folder.

The Save File intent calls importDocument(at:toParentItemIdentifier) via XPC for the selected vault and is considered successful once the file has been imported locally and the upload has been scheduled. Thus, this behaves analogously to manually importing a file via the Files app. This is important to ensure a fast runtime of the single intent, as they have a limited execution time.

@phil1995 phil1995 requested a review from tobihagemann May 24, 2022 14:58
Copy link
Member

@tobihagemann tobihagemann left a comment

Choose a reason for hiding this comment

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

Haven't tested it yet, will review it tomorrow furthermore. Looking forward to it! Just wanted to request some minor changes for now that I've noticed briefly.

@phil1995 phil1995 merged commit d98a81b into develop May 30, 2022
@phil1995 phil1995 deleted the feature/shortcuts branch May 30, 2022 10:49
Copy link

@tdung tdung left a comment

Choose a reason for hiding this comment

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

Y

@micha-09
Copy link

micha-09 commented Jun 1, 2022

Do you have an Shortcut example, how it works? I don't know the correct parameter in path for Get Folder.

@tobihagemann
Copy link
Member

We've written a guide here: https://docs.cryptomator.org/en/1.6/ios/shortcuts-guide/

The link is also available in the settings of Cryptomator. Hope this helps!

@micha-09
Copy link

micha-09 commented Jun 1, 2022

Perfect thank 👍

@micha-09
Copy link

Are there any known issues while uploading pictures with shortcuts? The date (modified and created) of uploaded pictures is set to "upload date"?

@tobihagemann
Copy link
Member

The only known issue is also documented in the Shortcuts Guide. Uploading a large amount of photos at once is very slow so it's better to set a limit.

I wouldn't have considered the modification date to be an issue but you can certainly open a new one. I would even say that this is a feature request because the current feature is working as intended.

@XxBlackHatxX
Copy link

XxBlackHatxX commented Jun 11, 2022

I want to give an overwhelming thanks to your team for doing this. Adding shortcuts support allows a lot of customizations for different workflows. So far this has been working great for me. I even have an automation where it runs the shortcut anytime I plug in my charger. I was also able to create my own automation shortcut that was able to transfer my files over from Google Drive and into Cryptomator automatically.

I have been using the current actions but they require your vault to be unlocked before hand. It would be useful to have Shortcut actions for the following.

  1. Shortcut intent to check a select vaults status (ie locked or unlocked) and return the current state.
  2. Shortcut intent to deep link right into the vault I select (i.e. what ever link you use on the "Open in Files app" button in the app)
  3. Shortcut intent to lock a selected vault.
  4. Shortcut intent to unlock a selected vault. If that is not possible no.2 would be a great work around for that as well since when you use the deep link to the files app it asks you to unlock the vault.

I just created a feature request for this #229 . Keep up the great work this is a killer app for Apple users.

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.

Automatic Photo Upload: Reactively sync all photos from iPhone to a vault Add Shortcuts functionality
5 participants