Multiple accounts

11 views
Skip to first unread message

Pintac

unread,
Aug 11, 2010, 3:03:21 AM8/11/10
to android-c2dm
Hi

What account will the register intent use if you have multiple
accounts and is there a way to pass the accont details for the account
you want to use.

thanks

debajit

unread,
Aug 11, 2010, 4:21:41 AM8/11/10
to androi...@googlegroups.com
hi Pintac,

one of the Google accounts will be used -- which one is used is not visible/under the control of your application, as this Google account is just used to authenticate the registration request to Google's servers.  this account has no impact on your application -- if your application wishes to use a Google account (e.g., with an appengine backend), or any other type of account credentials specific to your domain, it can pass that to its application server, along with the registration id that it receives in response to its registration request.

does that answer your question? =)

thx, debajit

debajit

unread,
Aug 11, 2010, 4:28:54 AM8/11/10
to androi...@googlegroups.com
btw, note that if you're talking about the role account ("sender" in http://code.google.com/android/c2dm/#registering), that has nothing to do with the accounts registered on a specific device.  the role account is what your app server will use to authenticate its /c2dm/send requests, whereas the accounts registered on a specific device have no knowledge or relationship to the role account used by your app.

Pintac

unread,
Aug 11, 2010, 4:35:30 AM8/11/10
to android-c2dm
thanks.

So in that case the actuall registrion is not bound to the email if
its just used for auth to google.

Then i assume its bound to the device/app in someway.

The reson i am asking i am busy building the app server side and i
need to identify the registrion so i need to know what the registrion
id is bound to.

If you look in the jumpnote example it looks like it use email because
if you add a note you hve to loggin to gmail.


On Aug 11, 10:28 am, debajit <deba...@android.com> wrote:
> btw, note that if you're talking about the role account ("sender" inhttp://code.google.com/android/c2dm/#registering), that has nothing to do
> with the accounts registered on a specific device.  the role account is what
> your app server will use to authenticate its /c2dm/send requests, whereas
> the accounts registered on a specific device have no knowledge or
> relationship to the role account used by your app.
>
> On Wed, Aug 11, 2010 at 1:21 AM, debajit <deba...@android.com> wrote:
> > hi Pintac,
>
> > one of the Google accounts will be used -- which one is used is not
> > visible/under the control of your application, as this Google account is
> > just used to authenticate the registration request to Google's servers.
> >  this account has no impact on your application -- if your application
> > wishes to use a Google account (e.g., with an appengine backend), or any
> > other type of account credentials specific to your domain, it can pass that
> > to its application server, along with the registration id that it receives
> > in response to its registration request.
>
> > does that answer your question? =)
>
> > thx, debajit
>

debajit

unread,
Aug 11, 2010, 4:47:17 AM8/11/10
to androi...@googlegroups.com
if you want to associate the registration to a specific account that your app and app server use for their own app-specific communication, you can include that in the request your app sends to your app server to let it know what registration id it received.  if you want to use a Google account (e.g., if you're using appengine as your backend) , you can pick one (or possibly have a ui to let the user pick which account(s) have been configured), you can use the account manager in a similar fashion to the chrometophone (single account) example or jumpnote (multiple account) sample app.

Pintac

unread,
Aug 11, 2010, 5:02:54 AM8/11/10
to android-c2dm
Yip

it would be much nicer to say send msg to app1 pie...@gmail.com
instead of send message to
regid=smdfghskfhjksdhfkjshdkfjhsdkjfhskjdhfkjshdkjfhsdkjf

Costin Manolache

unread,
Aug 11, 2010, 10:07:49 AM8/11/10
to androi...@googlegroups.com
On Wed, Aug 11, 2010 at 2:02 AM, Pintac <fbar...@gmail.com> wrote:
Yip

it would be much nicer to say send msg to app1 pie...@gmail.com
instead of send message to
regid=smdfghskfhjksdhfkjshdkfjhsdkjfhskjdhfkjshdkjfhsdkjf

A user can have multiple phones, and your server may have its own accounts and 
passwords. 

The registration ID is not tied to the account(s), but to device - we use one of the 
accounts to authenticate to prevent some abuse cases. 

Costin
Reply all
Reply to author
Forward
0 new messages