Disabling iCloud per app in iPhone Settings - iphone

I am using iCloud key-value storage in my app (ios 5.0+) and I wonder if it is possible to turn it on/off from within Settings/iCloud, similar way we can turn off Facebook/Twitter (per app) ?
I would prefer not to implement my own popups etc.
Best regards

In Settings -> iCloud -> Documents and Data you can enable / disable use of iCloud for Documents and Core Data on a per app basis, but not for iCloud key value storage.
If your app only uses iCloud key value storage it won't even appear in the list of apps on the settings pane.
So, the answer to your question is, no, it's not possible.

Related

Can I use NSUserDefaults with tvOS?

The App Programming Guide for tvOS briefly states that
There is no persistent local storage for apps on Apple TV. This means that every app developed for the new Apple TV must be able to store data in iCloud and retrieve it in a way that provides a great customer experience.
Does this mean NSUserDefaults is unavailable? What mechanisms are available for data storage?
According to an Apple Staff member on the devforums, you can use NSUserDefaults on tvOS for up to 500 kb of data:
https://forums.developer.apple.com/message/50696#50696
You can use NSUserDefaults for TVOS as per documentation.
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/UserDefaults/AccessingPreferenceValues/AccessingPreferenceValues.html
Apple really wants you (and AppleTV customers) to sign up for and use iCloud.
Here is the current documentation on what to do for persistent storage with AppleTV.
The introductory paragraph:
Storage on Apple TV is limited, and there is no guarantee that
information stored on the device will be available the next time a
user opens your app. Also, in order to share the user’s data across
multiple devices, you need to store the user’s information somewhere
other than the Apple TV. Apple provides two shared storage options for
Apple TV: iCloud Key-Value Storage (KVS), and CloudKit.
For files less than 1 meg, you'll use iCloud Key-Value Storage (KVS). For storage more than 1 Meg, you'll use CloudKit.
To follow up #vegashacker's answer, the same Apple staff member also said:
You can also store content locally using the application temp and
cache directories, but note that this data will be purged.
The purge is likely to happen when you app is no longer running, e.g. when resources are under pressure, or at reboot.
NSUserDefaults is available but has a limited size on tvOS. According to Apple staff on forum "NSUserDefaults is allowed, and supports up to 500KB of data." and also "The behaviour is the same as on iOS: NSUserDefaults is persistent as long as the user does not delete the app from the device."
Also according to NSUserDefaults.h header
"NSUserDefaultsSizeLimitExceededNotification is posted on the main queue when more data is stored in user defaults than is allowed. Currently there is no limit for local user defaults except on tvOS, where a warning notification will be posted at 512kB, and the process terminated at 1MB. For ubiquitous defaults, the limit depends on the logged in iCloud user."

iCloud synchronization does not work for an app on iPhone 4S and 5

Summary:
Application installed on iOS (iPhone 4S or iPhone 5 - tested on both) that supports iCloud synchronization does actually not synchronize with iCloud. The iOS version is 6.1.2.
We are developing an application and added iCloud support. The provisioning profile was recreated with iCloud enabled and stored on the device. The entitlements were properly configured in xcode to use iCloud and a Key-Value Storage (the values for the identifier are set to defaults). We followed the Apple's iCloud Design Guide tutorial to implement functionality to sync with iCloud (using the NSUbiquitousKeyValueStore class to store and read values).
Steps to Reproduce:
Use an app with iCloud support (in development mode or an app installed from the App Store) on iPhone 4S or 5 (iOS 6.1.2 installed). Go to Settings > iCloud > Documents & Data and have Documents & Data enabled and Use Cellular Data disabled. Try to use the application with iCloud. The data are not synced between devices. We also tried as follows: run the application, store a value to iCloud, delete the application, install the application again, run the app, the value could not be retrived from the iCloud.
Turn off the iPhone and turn it back on.
Go to Settings > iCloud > Documents & Data and enable Use Cellular Data.
Now run the application with iCloud enabled and the value stored in the iCloud. The value is synced from the iCloud ... everything is working as it should.
Expected Results:
The iCloud synchronization works if Use Cellular Data is disabled and Document & Data is enabled in Settings > iCloud > Documents & Data.
Actual Results:
The iCloud synchronization will not work if Use Cellular Data is disabled in Settings > iCloud > Documents & Data.
Notes:
Also the notification NSUbiquitousKeyValueStoreDidChangeExternallyNotification has never fired the selector set unles the Use Cellular Data was enabled in Settings > iCloud > Documents & Data.
Could anyone reproduce the same behavior?
Could someone make iCloud sync to work with Use Cellular Data disabled in Settings > iCloud > Documents & Data?
Thanks in advance!
iCloud Key Value Storage is not reliable as it is expressed in iCloud Design Guide.
Data propagation might be delayed because of Key Value Storage throttling.
From the "Preferences and Settings" guide:
"The key-value store is intended for storing data that changes infrequently. If the apps on a device make frequent changes to the key-value store, the system may defer the synchronization of some changes in order to minimize the number of round trips to the server. The more frequently apps make changes, the more likely it is that later changes will be deferred and not show up on other devices right away."
Sometimes, due to this KVS throttling, NSUbiquitousKeyValueStoreDidChangeExternallyNotification doesn't fire, even if both Documents & Data option and Use Cellular Data option are enabled.
This might be your issue.
If not, you should wait for Apple staff to reply your bug report. (I suppose you have reported a bug, as your question is in Apple Bug Report format.)

iOS MDM - Making Managed settings permanent

As per the "Mobile Device Management Protocol" API document from Apple, I am trying to restrict access to Data Roaming on iOS devices connected to my MDM server.
I can toggle the Data Roaming setting by sending the appropriate Settings request, however the user can then toggle Data Roaming straight back on.
This is addressed in Apple's documentation with the following paragraph :
In iOS 5 or later, this command allows the server to set settings on the device. These settings take effect on a one-time basis. The user may still be able to change the settings at a later time. This command requires the Apply Settings right.
The "might" suggests to me that there should be a way to restrict this, but I can not find a complete list of Global Restrictions that might solve this problem.
Is there a way to remove access to either the "Data Roaming" settings option, or even disable access to the whole "Settings->General->Cellular" sub menu ?
I don't think it's possible.
I checked the document with configuration profiles:
http://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/iPhoneConfigurationProfileRef.pdf
Also, I checked iPhone configuration utility.
None of them has Data Roaming restriction.
So, the only thing available is that MDM Settings which you are using already.

Do apps need to ask user preference in order to use iCloud for simple data?

We are currently working on an app and would like to sync favorites across devices using iCloud. The favorites are fairly lightweight and text only. Do we need to ask the user for permission to use iCloud or can we simply go ahead and use iCloud if available?
I have setup all iCloud syncing code already. So it is more a question about AppStore submission rules. Any experiences?
Apple guidelines state that you should invite the user to use iCloud, and give them the choice as to whether they want to use it or not. (Documentation, see "Prepare Your App to Use iCloud").
As per the App Store Review Guidelines, there isn't a concrete rule that states you need to do this, it's more of a guideline and a courtesy. I'd suggest you do though, it provides a better user experience, and happy customers.
Why should I need permission anyway?
Users only have a limited amount of storage (typically the 5GB allowance), and it's up to them how it should be used. If all applications decided to use iCloud without permission, it'd be a free-for-all, and space would be eaten up fast.

What folders and files gets backed up through iTunes?

Everytime I get a call my old wallpaper shows even though I have a new one. I'm trying to find it on my iOS but I cannot seem to figure out where. So I'm trying to track down what folders gets backed up when i backup my iPhone since I have restored it and it's still there.
(I'm using a jailbroken device)
I know this isn't the actual folder names and etc but it will give you an idea what it's backing up though. Good Luck.
With iOS 1.1 and later
Safari bookmarks, cookies, history,
and currently open pages
Map bookmarks, recent searches, and
the current location displayed in
Maps
Application settings, preferences,
and data
Address Book and Address Book
favorites
Calendar accounts
Wallpapers
Notes
Call history
Mail accounts
YouTube bookmarks
SMS messages
Saved suggestion corrections (these
are saved automatically as you reject
suggested corrections)
Camera Roll (photos and screenshots
taken by the iPhone)
Voicemail token (This is not the
Voicemail password, but is used for
validation when connecting. This is
only restored to a phone with the
same phone number on the SIM card.)
Web clips
Network settings (saved Wi-Fi
hotspots, VPN settings, network
preferences)
Paired Bluetooth devices (which can
only be used if restored to the same
phone that created the backup)
Keychain (this includes email account
passwords, Wi-Fi passwords, and
passwords you enter into websites and
some other applications. The keychain
can only be restored from backup to
the same iPhone or iPod touch. If you
are restoring to a new device, you
will need to fill in these passwords
again.)
With iOS 2.0 and later (in addition to the above)
Managed Configurations/Profiles
List of External Sync Sources (Mobile Me, Exchange ActiveSync)
Microsoft Exchange account configurations
Nike + iPod saved workouts and settings
App Store application data (except the application itself, its tmp and caches folder).
With iOS 3.0 and later (in addition to the above)
Videos in Camera Roll
Per app preferences allowing use of location services
Offline web application cache/database
Voice Memos
Autofill for webpages
Trusted hosts having certificates that cannot be verified
Websites approved to get the location of the device
In-app purchases
New with iOS 3.1: Videos in the Camera Roll that are 2 GB or larger are not backed up (iOS 4 and later will back up videos 2 GB and larger)
All user documents and settings get backed up, Application settings as well as system settings.
Applications each have a Documents folder that user data can be saved to, so thats pretty much what gets backed up for applications, including app preferences.
These are the Wallpaper locations:
/private/var/mobile/Library/SpringBoard/HomeBackground.jpg
/private/var/mobile/Library/SpringBoard/HomeBackgroundPortrait.jpg
/private/var/mobile/Library/SpringBoard/LockBackground.jpg
/private/var/mobile/Library/SpringBoard/LockBackgroundPortrait.jpg
I have manually managed to find out what gets backed up and managed to solve the problem :)
I downloaded the trial of iphone packup extractor http://www.iphonebackupextractor.com/ and found what I was looking for.
Also it seems like I just had to change the lockscreen in the iPhone since the file called LockScreen.jpg was the picture I was looking for but since I had another lockscreen using winterboard I didnt think of this.
Good luck to anyone else who has problems similar to this.