1

I am developing a set of applications that require users to login with password. Every account will be valid for all the applications, so users just need to register once.

When user A downloads the application App1, he has to register because he has never registered in any of those applications. Then he downloads application App2 and I'd like to be able to detect that he has already used the application App1. I know how to do this (UIApplication canOpenURL: message). But what would be really amazing is logging him in automatically using the same credentials he used in the first app (or at least advising him that he can do that).

I always thought that we can not share data between different applications, but I have seen that Evernote and Evernote Hello apps can do so. In previous iOS versions we could use the uniqueIdentifier value, but this is deprecated now. Another solutions that comes to my mind is using the push notifications token, but we can not be completely sure that this is going to be the same for all the applications, right? Or we could use the device phone number (if it's an iphone), but I also think that Apple doesn't like us to use the user's phone number.

What is the best approach to do this? Thank you so much!

Community
  • 1
  • 1
Ricard Pérez del Campo
  • 2,387
  • 1
  • 19
  • 22

2 Answers2

3

You can use a shared keychain to store the username, password, etc and share it between apps.

see http://useyourloaf.com/blog/2010/04/03/keychain-group-access.html and apples example https://developer.apple.com/library/ios/#samplecode/GenericKeychain/Introduction/Intro.html

This is best because, 1) apple takes care of security. 2) it is persistant even after app deletion. 3) its ported across backups

Sathya
  • 2,197
  • 4
  • 22
  • 25
2

If you need to share data between iOS apps then you can use UIPasteboard. This blog article documents a way of doing that.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242