can i access a directory list on mobile devices using Trigger.io? - trigger.io

I want access to the file system to get a list of the photos on the device so as to be able to display them in my app.
I don't see a method in the API providing that information. Is there a way of getting at it?

We don't have an API method to list all the photos taken via your app, but you do have options for how to do that yourself.
Firstly, when doing forge.file.getImage, you can save the file objects for later use - in forge.prefs, for example, which does have a list keys method.
Or, if the photos are saved to the gallery, you could use the source: "gallery" argument to getImage, which would let the user browser through the available photos and select one.

Related

Objective c - How to check if the photo metadata has been changed

I am developing in-House iOS app with objective-c for capturing images and I'm depending on photos metadata to get the correct locations and dates, but the new iOS versions allow the user to adjusting and changing the whole photo information, and our field staff able to changing the photo metadata with fake details.
The only ways that can protect the informations:
1- How to check the photo if metadata has changed or not, and refuse the modified photo.?
2- It possible to create configuration file to make all photos with read-only?
The photo library, accessible through the Photos app, belongs to the user — not to you. So if you don't want the user to have normal powers over these photos, then don't store them in the user's photo library.
With other objects on iOS (I'm thinking of contacts in particular) you can store metadata of your own in Apple's database. I don't think that's the case with photos, sorry.
You could perhaps require your users take the photo in your app and store the location in a database of your own. You might be able to store the photo in the photos database if that's something you want.

Passing data between an iOS app on different devices

I’m looking for the best and efficient way to pass a Nested Array [[String]], from my app to the same app on another iPhone.
If let say for example, I have this Array saved on my app:
let array = [[“John”, “27”, “First”, “Castle”],[“Tom”, “25”, “Second”, “Boat”]]
I want to add a Share Button on my App that will allow this array to be shared via Bluetooth/Airdrop/Any Convenient Way between 2 iPhones.
Ideally click share, via airdrop, other user click accepts and clicks open with the app. And data is loaded. What is the best approach In order to achieve this. I looked at Share Extension and UIActivityViewController but can’t see what are the differences about them and what is best for my case to simply send data and receive data from and to my app.
Based on what you have said,
You could just use the UIActivityViewController to export your data to AirDrop (or etc)
and using the exported UTI, your app could open it once it detected.
for Sharing, you will have to use a custom data format (or file) and you can refer to this post, Sending custom data via UIActivityViewController
and for reading your custom file, here is a good tutorial of how to implement the Exported UTI https://www.raywenderlich.com/8413525-universal-type-identifiers-tutorial-for-ios-importing-and-exporting-app-data
Cheers,
Kel
One option (and probably the easiest) is to use iCloud, specifically the NSUbiquitousKeyValueStore.
More information here :
https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore
use UIActivityViewController to export your data using AirDrop. You can read the same in your app on other phone when it detects the exported UTI.

In a iOS app, how to share photos with another iCloud user without sharing the full UIImage, having iCloud handle this?

Many thanks for your help. I am developing an application in Swift for iOS 12+, using Xcode 11. It is a travelling application, and has a "Trip" Core Data entity. Each trip can hold notes, and I would like to use this library, ZSSRichTextEditor, to let the user edit and store the notes in rich text, optionally containing images. As it is, the library can insert images as links on the internet, or from the user Photos library. When using the latter option, the library takes the full UIImage and encodes it as base64, then it inserts it in the WKWebView that the library uses under the hood. Here comes my problem. I would like to let users of my app share trips between them, but I would like to not include the full pictures in the shared trip file, but references to the iCloud photo. Can somebody suggest a possible implementation ? Many thanks.

Saving files from an iOS app extension to the containing app

I'm working on adding the ability to use the share button to allow users to save files for use with my main application. Multiple file types (image, video, audio, pdf, etc) need to be supported.
A general use case would be:
The user takes a picture with the standard Camera app or audio recording using the Voice Memos app.
User clicks the Share button and selects my extension from the share list.
Dialog opens up giving the user to opportunity to give a description for the file.
File is saved to where my main app (the containing app) can later access and process it.
I've been able to get to the point where I am prompted to share the file, but I have not been able to find a location to successfully save to that my main app can later read from. Is this even possible? Is there a better way to handle this scenario?
I am currently doing this using Xamarin so debugging is not supported (and logging is minimal). If someone has an answer in Objective C, that would at least help point me in the right direction.
There are a few things that you need to do.
First, your app and your app extension should belong to the same app group:
https://developer.apple.com/library/prerelease/ios/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW19
Then you can access the shared storage with something like this:
var groupUrl = NSFileManager.DefaultManager.GetContainerUrl ("stackoverflow.com.mygroup")
Now you can access files in the directory pointed by groupUrl.
Xamarin's guide to creating Share extensions for iOS: http://developer.xamarin.com/guides/ios/platform_features/introduction_to_extensions/

iOS 8: Storage Provider extension allow for importing photos? Could it allow for photos to get inserted into iMessage?

The documentation for the Storage Provider extension only refers to documents and files. It's not clear if it works for images and photographs. For instance, could an app create an extension that gets invoked in iMessage when the user taps the camera icon to insert a picture from the Photo Gallery?
It depends on how Apple implements the iMessage photo picker. If they go through the document picker API, you will get a chance to provide images. If the use the photo picker view controllers, however (PhotoUI framework or otherwise), you will not be able to.
Apple is most likely to go through the second route, but if this is an important feature for you, make sure to file a an enhancement request with Apple and post the radar number here so people can duplicate.
As of beta 2, Apple does not use the document picker API, so you will not be able to add your own data source for images if the Messages app does not change.

Resources