Share data across multiple apps on iOS

北战南征 提交于 2019-12-06 02:29:43

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.

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.

Neal Ehardt

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/

Constantin Saulenco

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!