This seems like a simple problem, but the more I plan it out, the harder it seems. The basic idea is this:
Person A wants to give person B permission to see his/her data on person B’s device. Person A uses either person B’s phone #, email, or Facebook info to send a request to person B. A has a unique ID for their device, but A does not know B’s ID before the request. B might not have the app a well thus no account or ID exists.
What would be the best method for this handshake using phone #, email, or Facebook with a JSON, schemaless backend? I do have support for notifications, I’m just not sure how to properly and securely make the transfer so person A can have person B’s ID to always send data to them in the future.
There are just so many factors, I’m having trouble wrapping my head around it.
It was pretty rough to be honest. I used Parse as my backend and hooked up my users using Facebook & email. I had an intermediate table for sharing. Each user had an array of user IDs that they were sharing with. I enabled push notifications so that when you shared with another person, they got a notification and an option to return sharing. Thus, each user had an array of people they wanted to share with. The sticky part was the handshake which I still don’t like how I did. I basically check if each user has the other’s user ID in their sharing array. In my opinion, its very sub optimal, but it works for now.