rnystrom
rnystrom

Reputation: 1916

How to check if a person in your iPhone contact list has an app installed?

I want to allow people to privately share data with each other using their contacts list to select people to share with. I'm planning on using Push Notifications to notify others that they have been shared with, but how can I handle those that do not have the app installed?

The cases are that I have their phone # and/or email. I can simply send them a message saying "X wants to share Y with you", but how can I determine if I need to send a Push Notification or an email/text?

Upvotes: 2

Views: 1018

Answers (3)

Rok Jarc
Rok Jarc

Reputation: 18875

If you're looking for API then you're out of luck. You can always collect this personal data server-side with agreement of your users. There you can also manage groups and other community relations.

Upvotes: 3

Felix
Felix

Reputation: 35394

When the app registeres for push notifications you need to pass additional data to your server. The user could input their own email/phone which will be sent to the server so that users can find each other. The email/phone can be stored alongside with the push token. When someone wants to share something, you would search the corresponding push token in the database and send the notification through APNS. Note there can be multiple push tokens for one email or phone i.e. when a user has multiple devices.

The users of your app should be aware of the data which is stored on your server and should have the option to delete it. Also use the APNS feedback service to detect and remove invalid push tokens.

Upvotes: 2

twilson
twilson

Reputation: 2062

Check here:

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html

The crux of it though will be that you will need to store a token when the device is registered anyway to be able to send notifications to them, so you can use that.

And using The Feedback Service alluded to in the documentation, you can remove the token, should it fail too often.

But, as rokjarc said, if you're expecting a third-party API to exist, you're pretty much out of luck. Apple ahs done most of the work for you already anyway.

Upvotes: 2

Related Questions