Android Push: Firebase Cloud Messaging
by Matthias Wessendorf
Hi,
Wednesday at Google IO, Google did announce the availability of Firebase
Cloud Messaging (FCM), which deprecates Google Cloud Messaging (GCM).
Here is a quite from the GCM documentation website:
>>
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the
reliable and scalable GCM infrastructure, plus new features! See the FAQ to
learn more. If you are integrating messaging in a new app, start with FCM.
GCM users are strongly recommended to upgrade to FCM, in order to benefit
from new FCM features today and in the future.
<<
At the core FCM is basically the same as GCM-3 (e.g. topic support), but
there are some changes especially in the client SDKs. I've created a few
JIRAs to scope the body of work, needed to deliver FCM support on our SDKs,
as well keeping our server and documentation in sync with the latest
offering: https://issues.jboss.org/issues/?filter=12327296
Greetings,
Matthias
* https://firebase.google.com/docs/cloud-messaging/
* https://developers.google.com/cloud-messaging/
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
8 years, 6 months
Cordova-FCM issue (was: Re: Android Push: Firebase Cloud Messaging)
by Matthias Wessendorf
Hi,
I think I am running into the issue, that I am not having the
google-service.json file present, in my app.
My try to update our plugin is here:
https://github.com/matzew/aerogear-pushplugin-cordova/commit/0f10a771a2d6...
And I am using this app:
https://github.com/jboss-mobile/unified-push-helloworld/tree/master/cordova
My "www/push-config.json" file content is here:
https://gist.github.com/matzew/aebceece86f8ac5159ec7677a2fb347c
After updating that, I did follow the instructions, on the readme, in the
"cordova" folder of the helloworld:
1) cordova platform add android
2) cordova plugin add
https://github.com/matzew/aerogear-pushplugin-cordova\#fcm
3) cordova run android
But, when the app launches, it crashes
06-10 10:52:52.039 4894 4894 E AndroidRuntime:
java.lang.RuntimeException: Unable to get provider
com.google.firebase.provider.FirebaseInitProvider:
java.lang.IllegalStateException: Incorrect provider authority in manifest.
Most likely due to a missing applicationId variable in application's
build.gradle.
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread.installProvider(ActivityThread.java:5156)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread.-wrap1(ActivityThread.java)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.os.Handler.dispatchMessage(Handler.java:102)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.os.Looper.loop(Looper.java:148)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:5417)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
java.lang.reflect.Method.invoke(Native Method)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: Caused by:
java.lang.IllegalStateException: Incorrect provider authority in manifest.
Most likely due to a missing applicationId variable in application's
build.gradle.
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: at
android.app.ActivityThread.installProvider(ActivityThread.java:5153)
06-10 10:52:52.039 4894 4894 E AndroidRuntime: ... 10 more
06-10 10:52:52.040 4996 2592 W ActivityManager: Force finishing
activity org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity
06-10 10:52:52.129 23947 24146 I Icing : Indexing
B96E309EB2416B4DBFAE0D6623436A2C7956B584 from com.google.android.gms
06-10 10:52:52.222 4996 6509 I OpenGLRenderer: Initialized EGL, version
1.4
06-10 10:52:52.231 23947 24146 I Icing : Indexing done
B96E309EB2416B4DBFAE0D6623436A2C7956B584
06-10 10:52:52.236 23947 24146 I Icing : Indexing
209BD54564CA1E38C7343A8DD5819E6471F3968C from
com.google.android.googlequicksearchbox
06-10 10:52:52.269 4996 5005 I art : Background partial concurrent
mark sweep GC freed 22954(1750KB) AllocSpace objects, 0(0B) LOS objects,
26% free, 43MB/59MB, paused 1.180ms total 114.805ms
06-10 10:52:52.321 23947 24058 I Icing : Indexing done
209BD54564CA1E38C7343A8DD5819E6471F3968C
06-10 10:52:52.661 4996 5039 W ActivityManager: Activity pause timeout
for ActivityRecord{16012ae u0
org.jboss.aerogear.unifiedpush.HelloWorld/.MainActivity t1391 f}
On Fri, Jun 10, 2016 at 12:02 AM, Julio Cesar Sanchez Hernandez <
jusanche(a)redhat.com> wrote:
> 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(a)redhat.com>
> wrote:
>
>>
>>
>> On Thu, Jun 9, 2016 at 11:00 AM, Julio Cesar Sanchez Hernandez <
>> jusanche(a)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(a)redhat.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Thu, Jun 9, 2016 at 2:19 AM, Erik Jan de Wit <edewit(a)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(a)lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> aerogear-dev mailing list
>>>> aerogear-dev(a)lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>>
>>>
>>>
>>> _______________________________________________
>>> aerogear-dev mailing list
>>> aerogear-dev(a)lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>>
>>
>>
>> _______________________________________________
>> aerogear-dev mailing list
>> aerogear-dev(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>>
>
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
twitter: http://twitter.com/mwessendorf
8 years, 6 months
UnifiedPush Node sender move to Promises
by Luke Holmquist
Hello people,
I think i would like to move the unifiedpush-node-sender,
https://github.com/aerogear/aerogear-unifiedpush-nodejs-client , to be
Promise based.
Currently it uses callback pattern that many node.js packages use as well
as emitting events.
When i first created this 3 years ago, that was sort of the standard way of
doing things, but Promises have become very popular(i know i love them :))
and have been a native feature since node 0.12.x
considering we have not yet hit a 1.0.0, we can pretty much just make this
change and we will be ok.
If this is to big of a change all at once, we could always do both
callbacks and Promises. I think we did this for Datamanager in the past.
Perhaps once we fully move to promises, then we can hit a 1.0.0
My only concern is other projects that might be using the sender that are
not yet on node 0.12 or above, since this is when promises became native.
I would really like to not have to include the polyfill.
i suppose those users would need to stick to the previous versions then.
anyway, would like to hear some thoughts.
-Luke
8 years, 6 months
UPS Device Registration Endpoints
by Luke Holmquist
thats right folks, i'm asking this question on a Friday before a Holiday
weekend(US) at 3:52(est)
i've started to implement the Device registration endpoints in node and was
just wondering what the id is here in this header
-v -H "Accept: application/json" -H "Content-type: application/json"
-H "aerogear-push-id: someid"
is it something specific, or just a random number/alpha-numeric thingy
here is the doc link for reference:
https://aerogear.org/docs/specs/aerogear-unifiedpush-rest/#246535932
I've also decided to create this as a separate module instead of including
it in the node admin client here:
https://github.com/bucharest-gold/unifiedpush-admin-client
mostly becuase these registration endpoints don't needed to be KC
authenticated. and they could also be used on a IOT device or something
that runs node that has webpush/simplePush or some new crazy protocol.
-Luke
8 years, 7 months