TOO_MANY_REGISTRATIONS

2,992 views
Skip to first unread message

David

unread,
Sep 15, 2010, 8:31:45 PM9/15/10
to android-c2dm
During registration the receiver can get an error of
TOO_MANY_REGISTRATIONS if the user has too many C2DM apps registered
on the device. I understand I should handle this case gracefully, but
I'm wondering if we can get a good ballpark as to how many
registrations is too many. Basically I'm trying to assess the risk of
this happening. I installed 21 test apps that all request c2dm
registrations without receiving this error (but all using the same
email address, so I'm not sure how good my experiment is).

Also what is the correct way to handle this behavior? I could go
through the trouble of generating a list of applications that have
intent filters to handle the action
"com.google.android.c2dm.intent.REGISTRATION" and tell the user to
uninstall one, but that seems like a recipe for disaster for every
c2dm developer to be implementing themselves. I assume at some point
this will be configurable on the device through settings?

Costin Manolache

unread,
Sep 15, 2010, 8:59:29 PM9/15/10
to androi...@googlegroups.com
As with other limits - we're still tunning this, it is intended to prevent abuse while covering reasonable uses.

You have a good point - listing the 100 applications and asking the user to uninstall one 
seems like a nice but complicated thing to do. 

I'm not sure what's the right solution - if we find users with more than 100 apps using C2DM on a phone - we'll 
increase the limit.

( you can probably find out by continuing your experiment that the current value is 100 ) 

Costin

roger schildmeijer

unread,
Sep 16, 2010, 2:12:15 AM9/16/10
to androi...@googlegroups.com
On Thu, Sep 16, 2010 at 2:31 AM, David <docg...@gmail.com> wrote:
During registration the receiver can get an error of
TOO_MANY_REGISTRATIONS if the user has too many C2DM apps registered
on the device.  I understand I should handle this case gracefully, but
I'm wondering if we can get a good ballpark as to how many
registrations is too many.  Basically I'm trying to assess the risk of
this happening.  I installed 21 test apps that all request c2dm
registrations without receiving this error (but all using the same
email address, so I'm not sure how good my experiment is).

Also what is the correct way to handle this behavior?  
 
I would recommend to notify the user about the "too many registrations" problem and then use an exponential fallback algorithm for further connection attempts. (i.e. each retry after the 2nd attempt has a short blocking sleep that gets longer on each attempt. Its probably a good idea to have a bound for the maximum number of connection attempts).
 
I could go
through the trouble of generating a list of applications that have
intent filters to handle the action
"com.google.android.c2dm.intent.REGISTRATION" and tell the user to
uninstall one, but that seems like a recipe for disaster for every
c2dm developer to be implementing themselves.  I assume at some point
this will be configurable on the device through settings?

wbr
Roger Schildmeijer

Costin Manolache

unread,
Sep 16, 2010, 2:20:30 PM9/16/10
to androi...@googlegroups.com
On Wed, Sep 15, 2010 at 11:12 PM, roger schildmeijer <schild...@gmail.com> wrote:


On Thu, Sep 16, 2010 at 2:31 AM, David <docg...@gmail.com> wrote:
During registration the receiver can get an error of
TOO_MANY_REGISTRATIONS if the user has too many C2DM apps registered
on the device.  I understand I should handle this case gracefully, but
I'm wondering if we can get a good ballpark as to how many
registrations is too many.  Basically I'm trying to assess the risk of
this happening.  I installed 21 test apps that all request c2dm
registrations without receiving this error (but all using the same
email address, so I'm not sure how good my experiment is).

Also what is the correct way to handle this behavior?  
 
I would recommend to notify the user about the "too many registrations" problem and then use an exponential fallback algorithm for further connection attempts. (i.e. each retry after the 2nd attempt has a short blocking sleep that gets longer on each attempt. Its probably a good idea to have a bound for the maximum number of connection attempts).

Exponential backoff is best for SERVICE_NOT_AVAILABLE. 

However in this case I don't think it makes sense to retry automatically - the user should correct the problem and than have a 
way to retry registration. Same for the other permanent errors - ACCOUNT_MISSING, INVALID_SENDER, etc. 

I think another error message deserves attention - PHONE_REGISTRATION_ERROR. I see a few happening already in logs - 
it's usually a 'custom ROM' case, but I didn't find yet which ROM and how to reproduce this, and I'm not aware of any
way to fix it   (besides asking the user to use an official froyo build or a better 'custom' ROM ). 



Costin

David

unread,
Sep 16, 2010, 2:45:43 PM9/16/10
to android-c2dm
Totally agree. Our app doesn't require c2dm, it is merely enhanced by
it, so I'm going to treat this case as the same as an app running
2.1. Now that I know that the limit is 100 apps, I am not as worried
about this being a common issue. I'll log it and if it becomes a
problem someday consider giving the user instructions on which apps
can be uninstalled to allow c2dm to work for them.

Thanks for the speedy and helpful response!
-David

On Sep 16, 11:20 am, Costin Manolache <cos...@gmail.com> wrote:
> On Wed, Sep 15, 2010 at 11:12 PM, roger schildmeijer <schildmei...@gmail.com
>
>
>
>
>
> > wrote:
Reply all
Reply to author
Forward
0 new messages