2

Scenario:

  • I "control" two different apps, App A and App B, both which the user has installed
  • App A is running
  • App A needs to obtain a string that was set by App B when App B last ran.
  • After obtaining the string, App A will still be running
  • User should not receive any feedback this communication is happening. E.g. no "switching animations" between A or B, no pop-ups, etc.

Constraints:

  • Apps are released under different vendors
  • Apps are already in the app store; updated versions will have this communication ability.
  • It is acceptable for the data stored in App B to be accessible to other apps on the device.
  • It is not acceptable for the data stored in App B to be visible to general third parties (e.g. if an external server is used, there needs to be some sort of secured scheme)
  • The data read should be able to occur immediately upon App A being opened after install. For instance, I cannot require the user of App A to enter log in credentials for an external communication service.
  • Must work on non-jailbroken devices.

This is seeming rather difficult to pull off in iOS7. Help is appreciated.

UsAaR33
  • 3,536
  • 2
  • 34
  • 55
  • Why did you post another question? You should have updated your last question with the clarifications. – rmaddy Mar 06 '14 at 04:42
  • Oh figured the existing answers there could be valuable to others with different constraints from mine. Sorry if this is bad stack overflow form. – UsAaR33 Mar 06 '14 at 04:43
  • possible duplicate of [Share data between two or more iPhone applications](http://stackoverflow.com/questions/9425706/share-data-between-two-or-more-iphone-applications) – jweyrich Mar 06 '14 at 04:59
  • @jweyrich: Those answers are outdated or don't apply. URL schemes require swtiching apps; UIPasteBoard is now sandboxed; shared keychains were always sandboxed; DocumentInteraction and ActivityView is visible to users. – UsAaR33 Mar 06 '14 at 05:37
  • This is an interesting scenario. Maybe you could use a couple of hours from your Apple support? If that's not viable, I'd post it to the Apple forums as well. Hopefully an Apple engineer tells you whether this is possible and describes how to properly achieve this. – jweyrich Mar 12 '14 at 19:33
  • Were you able to figure out a solution to this? – crawler Sep 14 '16 at 09:08

2 Answers2

2

Tricky work around. Not recommended, but it will get the job done if you can't afford servers.

On the first app create a contact in the user's contacts book. Give it a generic name like "000 - NameOfAppB Data - Don't Delete" (I start with "000" so it goes to the bottom of the users contact book so they never see it, I also add "don't delete" so if the user does somehow find it they don't delete it hahaha) (who looks at contact books anyways). In the contact info under notes add your NSData in string format.

Then when app A is opened search for that contact, read the data, then delete the contact.

Apple does allow you to create and delete users contacts without their permission. (At least in 2011 they did, this may have changed).

Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195
  • 1
    +1 for creativity. Although, I think you need permission after iOS 6. – Marcelo Mar 06 '14 at 05:57
  • Creative solution, but iOS 6 requires user permission to access contacts. I couldn't justify or require users to provide such permission. – UsAaR33 Mar 06 '14 at 06:40
  • @UsAaR33 Ah, I was afraid that would be the case, back in 2011 this wasn't required haha! I'll see if I can think of anything else :D – Albert Renshaw Mar 06 '14 at 06:40
0

This might serve your purpose

https://developer.apple.com/library/ios/documentation/Security/Reference/keychainservices/Reference/reference.html

I am not sure of its limitations though, i have seen implementations where credentials have been shared between apps.

Community
  • 1
  • 1
Preson
  • 244
  • 2
  • 8
  • AFAIK, can't do this because apps are from different vendors. http://stackoverflow.com/questions/11793271/keychain-group-access-to-share-data-between-my-existing-applications – UsAaR33 Mar 06 '14 at 05:41