Domanda

I know there are quite a few threads on this, but it seems none of them would satisfy what I am trying to look for. Here's my constraints:

  • not a hack that uses private API/framework or undocumented directory access that would run the risk of app being rejected because of that
  • being able to share data across different vendors / app developers
  • data can persist outside the lifecycle of the app (even after app is deleted)

UPDATED: I was in general trying to stay away from using a 3rd party cloud-based service to achieve the goal as this would introduce additional external dependency. But if I have to, I was hoping it could satisfy this one constraint

  • being able to tell which iOS device it is communicating with. It shouldn't have to uniquely identify the device (which will go into that evil UDID discussion route as we all experienced ). But as long as it can differentiate among different iOS devices it should be fine.
È stato utile?

Soluzione 2

Maybe this blog post by TextExpander authors will help:

Smile has responded to this by discussing the issue with Apple engineers at WWDC, filing a bug (#14168862), and checking up on the status of that bug. We also developed a workaround by storing the TextExpander data in a new place. Reminders requires user consent to store and retrieve data. Completed reminders are not normally shown in its interface. Long-past reminders appear at the bottom of the completed reminders.

TextExpander touch 2.1 (and later) supports storing shared snippet data in a long-past, completed reminder. We produced an updated SDK and kept our developers posted on its progress. Our final SDK was ready within a few hours of the end of Apple's official iOS 7 announcement.

UPDATE (22.11.2013) This might not be the best way to do that, because TextExpander's team recently had problems with the App Review Team.

Altri suggerimenti

I kind of need this too. I use Parse.com as the backend of all my apps — their free tier should satisfy your development needs.

Parse has APIs available for iOS, Android, Windows 8, OS X, JavaScript and .NET, with all your data available on the cloud on any platform (contrary to Core Data and iCloud). They also offer "Cloud Code," which is code you can execute remotely, to process information remotely and get the data back to your app.

You should definitely check Parse.com out for cloud storage for your app. In my experience, it really gets the job done.

For Data Persistence, I think you might want to take a look at FMDB (although if you decide to persist data locally, it will get deleted with your app, but it might help you, anyways). Core Data is an overkill in many cases.

Edit: Parse.com has an "Installation" class, in which all the devices that have your app installed get listed (wether they're running iOS or Android), uniquely, without you having to type any code.

Edit: this only works for apps with the same vendor.

You can save a password to the device's keychain, then access that password from any app.

Using the SSKeychain library...

NSString *service = @"com.yourcompany.yourservice";

// read
NSString *password = [SSKeychain passwordForService:service account:@"user"];

// write
[SSKeychain setPassword:password forService:service account:@"user"];

The password string doesn't have a length limit, so encode all your data as a string and save it there. The keychain entry will persist after the user deletes the app.

One of the ways to do this is using THRIFT. This is a data communication protocol that would need a back end server (private) and THRIFT can be compiled into many languages / platforms. There is a meta language to describe the data and then can be thrift compiled into many languages. Write the data definition once and can be used on many platforms.

More information at.

http://thrift.apache.org/

for me (I have 2 apps and a widged) the best solution is using SSKeyChain and do not forget to add Capabilities for your apps like here

or if you don't wanna to use 3rd party library you can use NSUserDefaults and set the group identifier like here but again do not forget to add the group identifier in Capabilities in AppGroups section for all your apps that have share data.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top