UIFileSharingEnabled available in build.settings?

I need to setup file sharing between and app and iTunes. in the info.plist a property called UIFileSharingEnabled needs to be set. I didn’t see anything in the corona documentation for this option in build.settings. Is this possible? If not it there a timeline when it would be available?

thanks,
Jason [import]uid: 5687 topic_id: 1766 reply_id: 301766[/import]

This is one that a member of Corona would need to answer but I really could use some help on this one. Is there a way to set UIFileSharingEnabled? This allows users to upload files from their computer to their app and is done inside of the itunes/apps interface.

A free app out there that has this functionanlity is Beatwave. If you have this app installed and click on your device in itunes and then select the apps tab, you will notice there is a new section called file sharing under your list of apps. I need to make this available. Is this possible with corona?

thanks [import]uid: 5687 topic_id: 1766 reply_id: 5259[/import]

Have you tried adding the “UIFileSharingEnabled = true” to the iphone/plist entry in build.settings? I don’t know what else is required to enable sharing but I believe that parameter would be included in the info.plist file when the app is built.

settings = {  
 iphone =  
 {  
 plist =  
 {  
 UIFileSharingEnabled = true,  
 UIStatusBarHidden = true,  
 },  
 },  
  
}  

No guarantees, but you might try it and let us know.

-Tom [import]uid: 7559 topic_id: 1766 reply_id: 5324[/import]

Jason,

It works! I did a quick test and you can see the results here:

What I did is create a small app that saves an image of a display object to the Documents directory on the iPhone (system.DocumentsDirectory). The next time I dod a sync with iTunes, it was available in the file sharing section. The code below is supposed to list the files in the Documents directory. It works on the simulator, but not on the iPhone - but that is for display purposes only. The file sharing part sill works.

Here’s the code:

build.settings

settings = {  
 orientation =  
 {  
 default = "landscapeLeft",  
 supported = {  
 "landscapeLeft", "landscapeRight",  
 },  
 },  
 iphone =  
 {  
 plist=  
 {  
 UIFileSharingEnabled=true  
 },  
 },  
}  

main.lua:

[code]
local testBg = display.newRect(0,20,50,50)
testBg:setFillColor(23, 192, 50, 255)

local myGroup = display.newGroup()
local textObj = {}

display.save( testBg, “test.png”, system.DocumentsDirectory )

– function borrowed from some Lua site on the internet
function scandir(dirname)

dirname = string.gsub(dirname, “(%s)”, “\%1”)

callit = os.tmpname()
os.execute(“ls -a1 “…dirname … " >”…callit)
f = io.open(callit,“r”)
rv = f:read(”*all")
f:close()
os.remove(callit)

tabby = {}
local from = 1
local delim_from, delim_to = string.find( rv, “\n”, from )
while delim_from do
table.insert( tabby, string.sub( rv, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( rv, “\n”, from )
end
– Comment out eliminates blank line on end!
return tabby

end

– function borrowed from some Lua site on the internet
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end

files = system.pathForFile( “*”, system.DocumentsDirectory )

filetab = scandir(files)

– print (“Directory contents”)
textTitle = display.newText(“files in Documents directory:”, 0, 90, “Courier Bold”, 16)
textTitle:setTextColor(255,255,255,255)
textTitle.x = 50 + textTitle.width/2
myGroup:insert(textTitle)

local textY = 100
for n,v in ipairs(filetab) do
– print (n,v)
textY = textY + 10

dirs = string.split(v,"/")
filename = dirs[table.maxn(dirs)]

textObj[n] = display.newText(filename, 0, textY, “Courier”, 14)
textObj[n]:setTextColor(255,255,255,255)
textObj[n].x = 50 + textObj[n].width/2
myGroup:insert(textObj[n])
end
[/code] [import]uid: 8194 topic_id: 1766 reply_id: 5329[/import]

Great news. I believe the os.execute call is disabled for security reasons in the device builds. I’m surprised it works in the Simulator.

-Tom [import]uid: 7559 topic_id: 1766 reply_id: 5330[/import]

This is a huge help. Thank you this is just what I needed. This also gives me a much better understanding of how to set different properties in build.settings. thanks [import]uid: 5687 topic_id: 1766 reply_id: 5433[/import]