Ukitakemalcom / gcm

Automatically exported from code.google.com/p/gcm
Apache License 2.0
0 stars 0 forks source link

Ability to pick up the GCM sender ID from the Android app's config #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

This feature request follows the discussion on the android-gcm mailing list 
here: https://groups.google.com/forum/?fromgroups#!topic/android-gcm/T0FFavXQcmA

------------------------------------------------------------
We have different Google API projects for different environments that we have - 
dev, test, prod. These were created for OAuth2 integration earlier and we are 
looking at enabling Google Cloud Messaging for all these projects and use them 
in respective environments (we want to use the environment specific project IDs 
to keep GCM statistics for these isolated).

So, we would like to have the ability to pick-up the sender ID (based on the 
env the APK is built for) from our Android client's config file instead of 
hard-coding it in the code.

The issue we are facing is that GCMBaseIntentService expects sender ID to be 
passed in its constructor, where the app context is not available, else I could 
have fetched the config using it.
------------------------------------------------------------

The above mentioned mailing-list suggests a code change that will help such 
use-cases.

Thanks for your support.

Original issue reported on code.google.com by roshanda...@gmail.com on 12 Jul 2012 at 4:29

GoogleCodeExporter commented 9 years ago
Submitting a patch here - slightly improved version of the solution that was 
suggested on the mailing list.

Original comment by roshanda...@gmail.com on 13 Jul 2012 at 6:23

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed on 
http://code.google.com/p/gcm/source/detail?r=2f8f3795e6e7ae45be1f8856fcd5047fe04
1ada4

Will be available in the next released version.

Original comment by felip...@android.com on 13 Jul 2012 at 6:19

GoogleCodeExporter commented 9 years ago
Fixed and released to SDK.

Original comment by felip...@android.com on 18 Jul 2012 at 11:21

GoogleCodeExporter commented 9 years ago
Thank you!

Original comment by roshanda...@gmail.com on 19 Jul 2012 at 3:42