[aerogear-dev] Consuming Google-Services.json

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] Consuming Google-Services.json

Summers Pittman
See JIRA : https://issues.jboss.org/browse/AGDROID-473

Background : Currently we have a developer manually enter the Google Project ID to enable push messages in their application.  However, this approach is considered "legacy" from Google's POV and they are encouraging consuming the Google-services.json file.

There are two ways we can consume this file.  The first is to parse it manually and extract the key "project_info/project_number"[1].  The second is to have the developer add the google services plugin to their Gradle projects and then we can consume the key from the resources with the field "R.string.gcm_defaultSenderId".  

I would prefer to parse the file manually.  It make our code less reliant on Google's tools and it allows our users to choose if they will use Google's plug in for its other features.  However, Google's plugin may provide extra features or validation which may be useful in the future.


Wdyt?

Summers


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] Consuming Google-Services.json

Matthias Wessendorf


On Mon, Apr 18, 2016 at 7:01 PM, Summers Pittman <[hidden email]> wrote:

Played w/ that file today as well :-)
 

Background : Currently we have a developer manually enter the Google Project ID to enable push messages in their application.  However, this approach is considered "legacy" from Google's POV and they are encouraging consuming the Google-services.json file.

There are two ways we can consume this file.  The first is to parse it manually and extract the key "project_info/project_number"[1]. 

That's sounds most safe thing, and it's safe, according to Google :) 
In case the "project_number" is not present (e.g. dev is 'smart' and edits file), let's have a proper error and call it a day :-) 
 
The second is to have the developer add the google services plugin to their Gradle projects and then we can consume the key from the resources with the field "R.string.gcm_defaultSenderId".  

I would prefer to parse the file manually.  It make our code less reliant on Google's tools and it allows our users to choose if they will use Google's plug in for its other features. 

Yeah, I feel same, might be also a bit odd to rely on a plugin, just for this...
 
However, Google's plugin may provide extra features or validation which may be useful in the future.

Sure, comes time, we can see :) 
 


Wdyt?

Summers


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev