Does `QLPreviewItem` works with local files only? - ios

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.

Related

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)

Phonegap RemoteControls ios Plugin not working when device is offline

I am using RemoteControls phonegap plugin on iOS to control playing audio while device goes to sleep (https://github.com/shi11/RemoteControls) - great plugin !!
however - when the device is offline it does not work correctly … the audio title shows up as the full file path to the audio .mp3 rather than the 'title' passed to the plugin - this works fine when online.
It would seem the issue is down to the setting of the remoteImage - this is downloaded to the app to allow access offline but I use a 'Library no-cloud' location …. even if this is not set .. ie. remoteImage = "" it will not display the title - only the fullpath ( which is very confusing to the user). Even when device is online but the image path points to the local file thumbnail path then it fails to display the title (again just the local audio mp3 file path) … and no thumbnail image. But when online and the image points to a remote valid url image (even though the filepath to local audio .mp3 is the same) all works as expected.
I am no objective-c developer - but looking at the code it appears that it is expecting an image called 'no-image' when offline and can not find the thumbnail image path … but where should this be held ? and regardless of whether an image is available or not should the plugin still function so that the title is the one passed from the app (same as when online) as this is only a string …. not a file path !!
Any help really appreciated - great plugin but need it to work same way when offline ….
I think you're right. The plugin doesn't function accurately (or as you expected) when the device is offline. The only way to fix this is to fix the code and build/release. If it's not your code, or you can't fix it, then the vendor/maker has too. Contact them?

can we implement functionality like iBooks in our own app?

whenever we sync pdf files. it shows in our app.
because I want upload that pdf file on server.
but I couldn't find any other way to do that.
I have tried to access pdf from iBooks but there is no way to access other app file in our app.
so is their any way to do that?
appreciate for help
You can upload the PDF to your server and show a webview where you load the URL for your PDF file

SoundCloud uploads from iOS have incorrect download file name

I'm using the iOS API to upload wav files to SoundCloud. There's no problem with the upload, however, when I attempt to download the file on the SoundCloud website the file name is always "unknown". When I upload the same song from my computer the file name matches the title.
There's nothing in the API reference that indicates you can set the download file name, so I assume it's generated from the title. Is this correct? Is there any additional metadata that needs to be set to make this work?
Any insight would be appreciated. Thanks!
When downloading a sound file from the SoundCloud website, the filename the user sees is the one used by the original uploader when they uploaded the sound to SoundCloud.

Path to image from iOS Gallery Xamarin

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

Resources