Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSUserDefaults: Is it possible to get userDefaults from another app?

There are two apps installed on iPhone (myApp and competitorApp).competitorApp is saving user settings with using NSUserDefaults. I know all keys (value forKey) which using competitorApp. Is it possible to get values in myApp from competitorApp?

like image 659
Voloda2 Avatar asked Jan 20 '12 09:01

Voloda2


2 Answers

In the iOS App Programming Guide, in the Security section you can read:

For security reasons, iOS places each app (including its preferences and data) in a sandbox at install time. A sandbox is a set of fine-grained controls that limit the app’s access to files, preferences, network resources, hardware, and so on. As part of the sandboxing process, the system installs each app in its own sandbox directory, which acts as the home for the app and its data.

That means that if you're not interested in jailbreaking, what you want to do is not possible.

like image 70
phi Avatar answered Sep 30 '22 16:09

phi


No. Apps cannot access each other's user defaults, nor look inside each other's file system sandboxes. This is security working as designed.

like image 20
Shaggy Frog Avatar answered Sep 30 '22 15:09

Shaggy Frog