[aerogear-dev] Android Push: Firebase Cloud Messaging

Julio Cesar Sanchez Hernandez jusanche at redhat.com
Thu Jun 9 18:02:57 EDT 2016


My fork is here
https://github.com/jcesarmobile/phonegap-plugin-push/tree/FCM

I didn't add the .json and I'm receiving push notifications

Last time I read the GCM docs they were already talking about that .json (I
think it was on February or March), it's not a new thing on FCM.

On Thu, Jun 9, 2016 at 6:38 PM, Summers Pittman <supittma at redhat.com> wrote:

>
>
> On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <
> jusanche at redhat.com> wrote:
>
>> I don't think that file is really needed, the phonegap-plugin-push (
>> https://github.com/phonegap/phonegap-plugin-push) doesn't use it and
>> push notifications work without it. The Sender ID is set on plugin install
>> passing it as a variable. Not sure what other values are included on the
>> google-services.json
>>
>
> This plugin isn't using Firebase.  We didn't need google-services.json for
> GCM3.
>
>
>>
>> I forked the phonegap plugin to add FCM support and it works too without
>> the google-services.json file too.
>>
>>
>> Sauce?
>
> Firebase requires two variables, the application id and the sender id.
> Fortunately the senderId is embedded in the applicationId.
>
> I've made a PoC version of AGDroid-push here :
> https://github.com/secondsun/aerogear-android-push/tree/no_google_services
> and a Poc Puhs app here :
> https://github.com/secondsun/unified-push-helloworld/tree/no_google_services
>
>
> As you can see I've just overloaded the SenderId.
>
>
>>
>> On Thu, Jun 9, 2016 at 2:04 PM, Summers Pittman <supittma at redhat.com>
>> wrote:
>>
>>>
>>>
>>> On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <edewit at redhat.com>
>>> wrote:
>>>
>>>>
>>>>> I am now actually wondering, where to put the google-service.json file
>>>>> on Cordova (no I am not updating our plugin), but I have no clue what is
>>>>> matching the native 'app' folder in Crodova land, is it WWW foldeR?
>>>>>
>>>>>
>>>>> https://github.com/jboss-mobile/unified-push-helloworld/tree/master/cordova
>>>>>
>>>>> hrm...
>>>>>
>>>>>
>>>>
>>>> There is no native folder on a cordova project, but we can put
>>>> something in the plugin.xml that will install / copy it into the native
>>>> project:
>>>>
>>>> <resource-file src="src/android/google-services.json" target="google-services.json" />
>>>>
>>>>
>>>> https://github.com/aerogear/aerogear-cordova-push/blob/master/plugin.xml#L64
>>>>
>>>> Don't know what the content is of this file seems the
>>>> https://github.com/jboss-mobile/unified-push-helloworld/pull/31 demo
>>>> doesn't have this google-services.json
>>>>
>>>
>>> Correct.  The documentation is being updated to cover the fact the
>>> developer needs to add the file.  If the file is not present the developer
>>> gets a useful error message in his/her log when registration fails.  If the
>>> file is present but incorrect (as say a stubbed file) then then developer
>>> gets a less useful message.  We chose to leave it out because it is more
>>> clear what the problem is, and a quick google search for
>>> "google-services.json" takes the user exactly where they need to go.
>>>
>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>>        Erik Jan
>>>>
>>>> _______________________________________________
>>>> aerogear-dev mailing list
>>>> aerogear-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>
>>>
>>>
>>> _______________________________________________
>>> aerogear-dev mailing list
>>> aerogear-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>
>>
>>
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>
>
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20160610/a80d4b81/attachment.html 


More information about the aerogear-dev mailing list