On Apr 15, 2016, at 7:54 PM, Karthik Rajagopalan 
<[email protected]<mailto:[email protected]>> wrote:

1) Once a new user signup, we like to have a user-profile created for them with 
UUID as their email-id(username).  This will be written to CBL and kickstart a 
push replication to sync_gateway.

The usual way to do registration is that you create your own API on the server 
to handle registration requests, and the server-side handler for this talks to 
the Sync Gateway admin API to create the user account and (if you want) a user 
profile document. Then when the user logs into their new account the profile 
doc is already there.

At this point of time, we like to have a separate channel created for the 
user's profile to deal with sync_gateway. How should we handle it?

You don’t have to create channels. A channel comes into existence when a 
document is assigned to it. So just define what your channel names will look 
like, and have the sync function use that naming scheme when it calls channel().

2) Once the user is signed in,  the user can enter into the user profile screen 
and edit some of the fields. What's the best approach to deal if the document 
has already been updated from different mobile? Should we make sure to pull 
first and then allow user to edit?

Yes, you’d want to pull first. You don’t need everything, just some channel 
that contains the profile doc.

How should we deal if the network connectivity is lost at this point of time? 
Should we just schedule a continuous pull and just write to CBL always?

It’s unlikely that the network would go down right after registering, but in 
any case you’d want to start a pull replication and then wait for the 
user-profile document to appear in the database. You can either do this 
modally, or else let the app run but just disable any features that involve 
accessing the profile until it arrives.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/4A431E8B-8B5E-459C-A52C-B5E54A9E83A4%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to