App is storing iCloud data, even though I haven't specified iCloud data

Hello!

When I submitted my app and it went through the review process, Apple rejected the app because it stores 7.21 MB on the user’s iCloud account after launch. Here’s a message from the review team:

“As we discussed, your app currently stores 7.21 MB on the user’s iCloud account after launch. The permitted maximum for this storage is 6MB. We are requiring that your app be brought into compliance with Guideline 2.23.” - Apple

I’m using version 2016.2873 (2016.4.30), below is a copy of my build.settings, and I’m using Rob’s loadsave.lua. I’m not intentionally storing data on iCloud and I’m not sure how to even start tracking iCloud storage of the app. 

Is it possible to identify what’s being stored? If so, how? Additionally, does Corona allow me to set a limit to the iCloud storage or specify to not use iCloud storage? 

-- -- For more information on build.settings see the Corona SDK Build Guide at: -- http://docs.coronalabs.com/guide/distribution/buildSettings/index.html -- settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", } }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, -- -- iOS Section -- iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, NSAppTransportSecurity = { NSAllowsArbitraryLoads = true }, --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXX",  -- replace XXXXXXXXX with your Facebook appId } } } --]] } }, -- -- Android Section -- android = { usesPermissions = { "android.permission.INTERNET",       "android.permission.ACCESS\_NETWORK\_STATE", }, }, plugins =   {     ["plugin.google.play.services"] =     {         publisherId = "com.coronalabs"     },       },  }

On an additional note, this app is a companion app and provides 2 food calculators (think weight watchers) and allows the user to track their weight. I’m storing the weight using loadsave.lua. 

Anything you save in system.DocumentsDrirectory gets backed up to iCloud. This is not part of our iCloud plugin. This is something iOS does automatically so people can back up their phone, get a new one and restore all their saved data. Because people have many apps, Apple limits the amount of data each app can store so there is plenty of space to go around for their other apps.

We have an API call that you can use to flag files that you do not want to back up. See:

https://docs.coronalabs.com/api/library/native/setSync.html

Files that can be re-downloaded from the Internet should be saved to system.CachesDirectory as it does not get backed up. Simply limit the data being backed up and you should be good to go.

Now a simple save of a settings table shouldn’t hardly be any data at all.

Rob

Rob could you provide anymore detail on what Corona might store in the system.DocumentsDirectory? Icon files, lua files, images etc?

Like thatssopanda I’m using the loadsave.lua and I am only saving a json dictionary of three elements. When I look at the “Show Project Sandbox” in the simulator and go to the documents folder it shows only my settings file with it being at 1KB. That is the only thing I am specifically saving for my app. However, my app also got rejected saying that I’m saving 7.66 MB to the user’s iCloud.

Do the icon files get stored under the system.DocumentsDirectory? I noticed that those might get to around 7.66 MB. But other than that I cannot figure out why I am storing so much.

Thatsopanda where you able to resolve this issue yet?

Thanks.

We don’t store anything in system.DocumentsDirectory. Only you would store things there. Icons, launch images, your apps artwork etc. is in system.ResourceDirectory and that’s not backed up. If Apple rejects you for this, ask them to give you a list of files and sizes to see what’s being saved.

Rob

I had to specify the files I was using with loadsave.lua to not sync with iCloud. This isn’t a good solution because the app that was rejected was an update. v1.0 has been live for quite some time and I’ve published 5-6 updates to the app. Then all of a sudden it was rejected for using too much iCloud data.

Rob, since it wasn’t just me that experienced this issue and the data amount is almost the same, maybe it’s something with loadsave.lua?

Ok, thanks Rob. I’ll send a message over to Apple then. I was just shocked since I’m only storing that one 1KB file which isn’t even close to 7MB. This is only my second app so that’s why I was thinking something else like icons were being stored in that directory because I’m only storing one file. I’ll respond back here if Apple gives me anything interesting with their response.

Panda where did you use that setsync API call? I was thinking about putting it in the main.lua or my mainMenu.lua file. Hmm, that’s really interesting that you had the issue on the update. Were you always using the loadsave with the previous versions?

I had an update rejected a few days ago because of icloud storage.

I simply wrote a message to the reviewer telling that my apo saved 8 KB of data instead of 8MB.
They just reviewed the update again and published it in less than two hours.

I wonder if their checking software is buggy. They’ve just switched to much faster approvals and it’s possible they are using more analysis software and these could be false positives.

Rob

@jjlam2015, I used the doc that Rob pointed out here - https://docs.coronalabs.com/api/library/native/setSync.html

Rob, I thought maybe it was on Apple’s side at first too. However, I’m not seeing a lot of chatter about other people getting the same rejection. There’s always the possibility that I’m just not seeing it! 

On an additional note, this app is a companion app and provides 2 food calculators (think weight watchers) and allows the user to track their weight. I’m storing the weight using loadsave.lua. 

Anything you save in system.DocumentsDrirectory gets backed up to iCloud. This is not part of our iCloud plugin. This is something iOS does automatically so people can back up their phone, get a new one and restore all their saved data. Because people have many apps, Apple limits the amount of data each app can store so there is plenty of space to go around for their other apps.

We have an API call that you can use to flag files that you do not want to back up. See:

https://docs.coronalabs.com/api/library/native/setSync.html

Files that can be re-downloaded from the Internet should be saved to system.CachesDirectory as it does not get backed up. Simply limit the data being backed up and you should be good to go.

Now a simple save of a settings table shouldn’t hardly be any data at all.

Rob

Rob could you provide anymore detail on what Corona might store in the system.DocumentsDirectory? Icon files, lua files, images etc?

Like thatssopanda I’m using the loadsave.lua and I am only saving a json dictionary of three elements. When I look at the “Show Project Sandbox” in the simulator and go to the documents folder it shows only my settings file with it being at 1KB. That is the only thing I am specifically saving for my app. However, my app also got rejected saying that I’m saving 7.66 MB to the user’s iCloud.

Do the icon files get stored under the system.DocumentsDirectory? I noticed that those might get to around 7.66 MB. But other than that I cannot figure out why I am storing so much.

Thatsopanda where you able to resolve this issue yet?

Thanks.

We don’t store anything in system.DocumentsDirectory. Only you would store things there. Icons, launch images, your apps artwork etc. is in system.ResourceDirectory and that’s not backed up. If Apple rejects you for this, ask them to give you a list of files and sizes to see what’s being saved.

Rob

I had to specify the files I was using with loadsave.lua to not sync with iCloud. This isn’t a good solution because the app that was rejected was an update. v1.0 has been live for quite some time and I’ve published 5-6 updates to the app. Then all of a sudden it was rejected for using too much iCloud data.

Rob, since it wasn’t just me that experienced this issue and the data amount is almost the same, maybe it’s something with loadsave.lua?

Ok, thanks Rob. I’ll send a message over to Apple then. I was just shocked since I’m only storing that one 1KB file which isn’t even close to 7MB. This is only my second app so that’s why I was thinking something else like icons were being stored in that directory because I’m only storing one file. I’ll respond back here if Apple gives me anything interesting with their response.

Panda where did you use that setsync API call? I was thinking about putting it in the main.lua or my mainMenu.lua file. Hmm, that’s really interesting that you had the issue on the update. Were you always using the loadsave with the previous versions?

I had an update rejected a few days ago because of icloud storage.

I simply wrote a message to the reviewer telling that my apo saved 8 KB of data instead of 8MB.
They just reviewed the update again and published it in less than two hours.

I wonder if their checking software is buggy. They’ve just switched to much faster approvals and it’s possible they are using more analysis software and these could be false positives.

Rob

@jjlam2015, I used the doc that Rob pointed out here - https://docs.coronalabs.com/api/library/native/setSync.html

Rob, I thought maybe it was on Apple’s side at first too. However, I’m not seeing a lot of chatter about other people getting the same rejection. There’s always the possibility that I’m just not seeing it!