Activity popup - sharing local file

Hello

iOS UIActivityViewController supports not only images, text and url, as Corona SDK through

native.showPopup, but also local files (using local url address NSURL and even NSData).

How could we share a local file located in system.DocumentsDirectory? For example a pdf or a zip file.

Thanks.

Have you tried:

local popupListener = {} function popupListener:popup( event ) print( "(name, type, activity, action):", event.name, event.type, tostring(event.activity), tostring(event.action) ) end local itemsToShare = { { type = "pdf", value = { filename = "your.pdf", baseDir = system.DocumentsDirectory } }, { type = "url", value = "http://www.coronalabs.com" }, { type = "string", value = "Hello World!" }, } local options = { items=itemsToShare, listener=popupListener } native.showPopup( "activity", options )

Thanks for the reply.

No, it does not work. Should it? Is this the correct way?

Are getting any errors?

No errors. Just the sharing UI in the iOS is empty.

If you have a suported component like image, then available for sharing is only the image.

As I understand by reading the ios dev documentation, the correct way is to do it with a local url.

I tried it as well (using the system.pathForFile) but no luck.

Hello

Any news on that?

Thanks.

You do have to apps like Facebook installed

Here is example check out the Google drive (image attached), notice how Facebook is missing.( I don’t have it on my phone)
If you are trying to share a image to Twitter and the app is not installed thier is nothing you can do (unless you use thier rest api in your app).

As an FYI, The activity plugin for iOS uses iOS’s built in FB support. If you’re not seeing that Icon you’ve not gone into your settings and setup your FB account. I don’t believe it’s dependent on the FB app being installed. 

The problem is how to share a file which is not an image, on an iOS device.

The native.showPopup( “activity”) as it is implemented in Corona SDK seems not to offer this functionality, which is supported natively.

iOS UIActivityViewController supports files as well and not only images, text and url, as Corona SDK.

thanks.

i have the same problem of photiscta, when i share a file which is not an image, as Rob Miracle suggested, the activity popup is empty

how can we solve that?

thanks

Please go to https://feedback.coronalabs.com and put in a request for the Activity plugin to support other file types and get it voted up.

Rob

Have you tried:

local popupListener = {} function popupListener:popup( event ) print( "(name, type, activity, action):", event.name, event.type, tostring(event.activity), tostring(event.action) ) end local itemsToShare = { { type = "pdf", value = { filename = "your.pdf", baseDir = system.DocumentsDirectory } }, { type = "url", value = "http://www.coronalabs.com" }, { type = "string", value = "Hello World!" }, } local options = { items=itemsToShare, listener=popupListener } native.showPopup( "activity", options )

Thanks for the reply.

No, it does not work. Should it? Is this the correct way?

Are getting any errors?

No errors. Just the sharing UI in the iOS is empty.

If you have a suported component like image, then available for sharing is only the image.

As I understand by reading the ios dev documentation, the correct way is to do it with a local url.

I tried it as well (using the system.pathForFile) but no luck.

Hello

Any news on that?

Thanks.

You do have to apps like Facebook installed

Here is example check out the Google drive (image attached), notice how Facebook is missing.( I don’t have it on my phone)
If you are trying to share a image to Twitter and the app is not installed thier is nothing you can do (unless you use thier rest api in your app).

As an FYI, The activity plugin for iOS uses iOS’s built in FB support. If you’re not seeing that Icon you’ve not gone into your settings and setup your FB account. I don’t believe it’s dependent on the FB app being installed.