Apple Rejected my Ap so I need some help here.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Apple Rejected my Ap so I need some help here.
Hi,
Need some help here.
My iPad application stores and uses PDF maps contained in 5 folders (for organization purposes) although I could condense them all into 1 large folder. (about 200 PDF's total) and I had them stored in the IOS /documents folder. I DO WANT TO BE ABLE TO UPDATE THESE MAPS VIA ITUNES. Apple design review wants me to store these PDF's in the IOS /Library/Private Documents folder. They also want me to set the "Do Not Backup Extended Attribute " of this folder to prevent iTunes or iCloud from backing up the data.
Here is the link they provided. https://developer.apple.com/library/ios ... index.html
They have given me directions to do this but it is in a programing language I don't understand. Here it is.
"You can use the following method to set the "do not back up" extended attribute. Whenever you create a file or folder that should not be backed up, write the data to the file and then call this method, passing in a URL to the file."
Listing 1 Setting the Extended Attribute
#include <sys/xattr.h>
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
Can anyone help me figure out a way to accomplish this with live code?
Thanks,
Dave
Need some help here.
My iPad application stores and uses PDF maps contained in 5 folders (for organization purposes) although I could condense them all into 1 large folder. (about 200 PDF's total) and I had them stored in the IOS /documents folder. I DO WANT TO BE ABLE TO UPDATE THESE MAPS VIA ITUNES. Apple design review wants me to store these PDF's in the IOS /Library/Private Documents folder. They also want me to set the "Do Not Backup Extended Attribute " of this folder to prevent iTunes or iCloud from backing up the data.
Here is the link they provided. https://developer.apple.com/library/ios ... index.html
They have given me directions to do this but it is in a programing language I don't understand. Here it is.
"You can use the following method to set the "do not back up" extended attribute. Whenever you create a file or folder that should not be backed up, write the data to the file and then call this method, passing in a URL to the file."
Listing 1 Setting the Extended Attribute
#include <sys/xattr.h>
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
Can anyone help me figure out a way to accomplish this with live code?
Thanks,
Dave
Re: Apple Rejected my Ap so I need some help here.
You've run up against the new iCloud data storage guidelines. The issue is summarized at http://www.chrisboyd.net/2011/11/icloud ... uidelines/
I fear that this will be an issue for many LC developers. As far as I know, there's no way to set the necessary file/folder attribute within LC. Hopefully this will be included in the upcoming LC5.5 release. If not, perhaps someone can throw together a quick and dirty external that will allow us to toggle the "do not backup" attribute.
In the meantime, the only option I can think of is for you to put your PDFs in the Caches folder, which means they will not be accessible via iTunes.
I fear that this will be an issue for many LC developers. As far as I know, there's no way to set the necessary file/folder attribute within LC. Hopefully this will be included in the upcoming LC5.5 release. If not, perhaps someone can throw together a quick and dirty external that will allow us to toggle the "do not backup" attribute.
In the meantime, the only option I can think of is for you to put your PDFs in the Caches folder, which means they will not be accessible via iTunes.
Re: Apple Rejected my Ap so I need some help here.
Hi...
Unless I'm missing something... I think this is covered in page 22 of the iOS release notes... under the heading 'file and folder handling.'
be well
Dixie
Unless I'm missing something... I think this is covered in page 22 of the iOS release notes... under the heading 'file and folder handling.'
be well
Dixie
Re: Apple Rejected my Ap so I need some help here.
A way to set the Do Not Backup Extended Attribute? Not in my version of the release notes (Rev 69).
Re: Apple Rejected my Ap so I need some help here.
Moving the PDF folders over to the other directory and re coding the links is easy but setting the "do not back up attribute" to meet the iCloud requirement is the problem.
Listing 1 Setting the Extended Attribute
#include <sys/xattr.h>
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
Can anyone help me figure out a way to accomplish this with live code?
Thanks,
Dave
Listing 1 Setting the Extended Attribute
#include <sys/xattr.h>
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
Can anyone help me figure out a way to accomplish this with live code?
Thanks,
Dave
Re: Apple Rejected my Ap so I need some help here.
Simpy, at moment, you can't without writing in XCode an External (http://www.runrev.com/developers/docume ... rnals-sdk/) ...FireWorx wrote:Moving the PDF folders over to the other directory and re coding the links is easy but setting the "do not back up attribute" to meet the iCloud requirement is the problem.
....
Can anyone help me figure out a way to accomplish this with live code?
Thanks,
Dave
... in a future release, probably, RunRev will include some new flags in the standalone builder (... or in the 'specific for iOS' language extensions).
Guglielmo
Re: Apple Rejected my Ap so I need some help here.
Fireworx,
My interpretation of the new rules its that you don't need to set the attribute for files in the /Library/Caches folder, because it's not backed up to iCloud. If you move your PDFs there, you should be OK. The only problem is that your users won't be able to see/update the PDFs via iTunes, and if a user runs low on space, iOS may purge the contents of Caches folders. Unless someone throws together a quick external, this is the only way I can think of to get your app approved. Once there's a better solution in LC, you can then update your app.
My interpretation of the new rules its that you don't need to set the attribute for files in the /Library/Caches folder, because it's not backed up to iCloud. If you move your PDFs there, you should be OK. The only problem is that your users won't be able to see/update the PDFs via iTunes, and if a user runs low on space, iOS may purge the contents of Caches folders. Unless someone throws together a quick external, this is the only way I can think of to get your app approved. Once there's a better solution in LC, you can then update your app.
Re: Apple Rejected my Ap so I need some help here.
Call-151,
he said very clearly "I DO WANT TO BE ABLE TO UPDATE THESE MAPS VIA ITUNES" so ... he can't use the Cache folder ...
Guglielmo
he said very clearly "I DO WANT TO BE ABLE TO UPDATE THESE MAPS VIA ITUNES" so ... he can't use the Cache folder ...

Guglielmo
Re: Apple Rejected my Ap so I need some help here.
Understood. I'm just suggesting a compromise that will at least get his app in the store. He seems to have the impression that even with the Caches folder he'd also need to set the do not backup attribute. That's not how I read the guidelines.gpb01 wrote:Call-151,
he said very clearly "I DO WANT TO BE ABLE TO UPDATE THESE MAPS VIA ITUNES" so ... he can't use the Cache folder ...
Guglielmo
Re: Apple Rejected my Ap so I need some help here.
Hi
I just uploaded a new external to http://mergext.com to do this. I've called it a beta but I can't imagine there being any issues with it.
Cheers
Monte
I just uploaded a new external to http://mergext.com to do this. I've called it a beta but I can't imagine there being any issues with it.
Cheers
Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: Apple Rejected my Ap so I need some help here.
Thanks Monte,
I will check it out.
Dave
I will check it out.
Dave
Re: Apple Rejected my Ap so I need some help here.
Good job Monte, ...monte wrote:Hi
I just uploaded a new external to http://mergext.com to do this. I've called it a beta but I can't imagine there being any issues with it.
Cheers
Monte
... maybe can you complete the external by adding the possibility to set also the NSFileProtectionKey (using SetAttributes:ofItemAtPath to set NSFileProtectionComplete or NSFileProtectionNone)

It would be very useful ...

Guglielmo
Re: Apple Rejected my Ap so I need some help here.
Sure, I'll take a look.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: Apple Rejected my Ap so I need some help here.
Thanks a lot Monte ...monte wrote:Sure, I'll take a look.
... if you login on the Apple developer area, you can read this : http://adcdownload.apple.com//wwdc_2011 ... ations.pdf ... starting from page 31.
Also the video is very clear

Guglielmo
Re: Apple Rejected my Ap so I need some help here.
Done, you can set the file protection key to any of the four available options. Also added a function to check if protected data is available. It is also possible to send callbacks if protected data becomes available or unavailable but unless someone needs that I won't bother.
Don't forget to vote for what you want next on mergExt!!!
Cheers
Monte
Don't forget to vote for what you want next on mergExt!!!
Cheers
Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/