Path to image from iOS Gallery Xamarin - ios

I was following this tutorial http://developer.xamarin.com/recipes/ios/media/video_and_photos/choose_a_photo_from_the_gallery/ and I can get the path for a video just by doing
mediaURL.Path
but with an image it returns something like
"assets-library://asset/asset.JPG?id=2A456415-B1AE-414A-9795-A0625K768EBD&ext=JPG"
and I can not use it to upload to my server because using FileInfo("imageLocaltion") will not find the file.
So with urls like the above how can I access the "real" file path?

See "display image from URL retrieved from ALAsset in iPhone" - the same mechanisms apply to Monotouch:
MonoTouch: Getting an Image out of ALAssetsLibrary.AssetForUrl

Related

Does `QLPreviewItem` works with local files only?

I'm uploading images to firebase and in return I'm getting uploaded image URL as https://firebasestorage.googleapis.com/v0/b/mobile-ae-4a739.appspot.com/o/images%2Feecae5f7-b578-483a-a2da-b166aaf5716c?alt=media&token=b6743df5-7276-4b83-8e2d-f741f42c956e.
Now, I have to display this image in QLPreviewController. I'm giving the above firebase URL of my uploaded image as QLPreviewItem, but QLPreviewController displaying filename text instead of image, you can see in the below screenshot. I confirm that the URL has image.
Can you please help me to show the images in QLPreviewController
QLPreviewItem works with local file URLs only, it won't download your file for you if you provide it a remote file url.
You need to download your file to your app's local file system before presenting QLPreviewController and provide it that local file url.
For advanced usage - multiple urls, dataSource, delegate handling - you should watch Quick Look Previews from the Ground Up from WWDC 2018.

How to get url with image with ios ShareExtension at the same time?

I want to share image URL with main homepage URL when sharing in safari to my iOS app with ShareExtension.
Example
Currently, I am only getting an image URL.
Is this possible to get a homepage URL with an image URL with ShareExtension?
[Edit]
Actually, I am using https://github.com/meedan/react-native-share-menu in React Native.
I've also gone through the ShareExtension doc in iOS but it seems that it checks the share type and sends image URL only for the intent. Code is all there in the GitHub and you may test it out with the Test project in Github.
I am just wondering if there is any way to get a homepage URL with an image URL when sharing the image. Because the system is easy to know the homepage url while sharing an image URL.

Launching an app with image data from an email

I know I can launch an iOS app using URL Schemes embedded in an email. How would I launch my app and pass it an image that is included in the email? Can the URL reference the image in the email? Or is it possible to automatically load the image to the clipboard? I'm trying to do this in one step and not have the user manually tap and hold to put an image on the clipboard. Thanks for your help.
Assuming the image is available from the web in some consistent format, perhaps it's best to:
Include the image's web address as part of the URL that opens your app
(myapp://getImage/uniqueImagePath/)
Get the image path via the referrer
Add the base url (myphotohost.com) and extension (.jpg) to the path
Download the image client-side
The consistent format would be myphotohost.com/uniqueImagePath.jpg
Here's a link that explains using an identifier (like uniqueImagePath in this context)

Does facebook images support Progressive JPEG?

In my iOS app, I'm using Pinterest's PINRemoteImage library to download images of Facebook pages, and I set the download property setUpdateWithProgress to true, so it will support it. But I see that every image shows up only when the download was completed.
Does anyone have a clue how to solve it? Do I need to add something to the URL?
This is the kind of URL that I use:
http://graph.facebook.com/<PAGE_ID>/picture?width=<WIDTH>&height=<HEIGHT>
The property updateWithProgress has been deprecated. You should use the property pin_updateWithProgress.

iOS tweet image - Can I get the image url before upload?

I want to be able to share images from my app on twitter/facebook/email etc..
There's probably hundreds of different ways to do this which is quite simple.
However what I need/want to do, is allow the images to be opened by other people straight into my app (If they have it installed).
So I have a url scheme so a url will open my app with an image like this:
myurlscheme://image?url=http://imageurl.com
The problem I have, is the process for uploading the image, but adding my url scheme to the beginning of the url.
If I could know the url twitter/facebook is going to use before I send the tweet, I could add my url scheme to the front of the image url and put it in the tweet. I'm guessing this might not be possible though.
Another thought is to upload the image to another service, get the url, then compose and send the tweet. Are there any suitable services for doing this? (Preferably free services) I dont really want to have to host the images myself.
Thanks
1) I don't see how you plan on conjuring an image URL before you upload the image - that is a chicken/egg situation. I would recommend taking a look at an actual image URL after you upload it to facebook, twitter, etc and try to figure out even one character of what it would be for the next image you upload. Regarding twitter specifically the image URL is also going to vary depending on what upload service is being used.
2) regarding uploading the image and getting the URL why not look into tapping into the flickr API?

Resources