Skip to content
This repository was archived by the owner on Feb 7, 2019. It is now read-only.

message as first argument, whole object as second - #4

Closed
fritzvd wants to merge 2 commits into
NativeScript:masterfrom
fritzvd:fritzvd/extra-parameters-for-callback
Closed

fritzvd wants to merge 2 commits into
NativeScript:masterfrom
fritzvd:fritzvd/extra-parameters-for-callback

Conversation

@fritzvd

@fritzvd fritzvd commented Nov 30, 2015

Copy link
Copy Markdown
Contributor

It seems like a good idea to read out other things then just the message. Backwards compatibility is ensured by still sending the message as a first parameter.

In these examples: https://developers.google.com/cloud-messaging/downstream#receiving-messages-on-an-android-client-app
it would seem that that is the intention of the message.

I'm not quite sure if this will work though, because I couldn't find a 'how-to-contribute' kind of page. So I'm not sure how to build the .jar that's a part of the npm package.

Let me know what you think of this change.

fritzvd and others added 2 commits November 30, 2015 19:29
It seems like a good idea to read out other things then just the message. Backwards compatibility is ensured by still sending the message as a first parameter.

In these examples: https://developers.google.com/cloud-messaging/downstream#receiving-messages-on-an-android-client-app 
it would seem that that is the intention of the message.

I'm not quite sure if this will work though, because I couldn't find a 'how-to-contribute' kind of page. So I'm not sure how to build the `.jar` that's a part of the npm package.

Let me know what you think of this change.
* Java Bundle as json, to string.. which is meh 😵
@fritzvd
fritzvd force-pushed the fritzvd/extra-parameters-for-callback branch from 76b65a9 to 2fd96ff Compare December 3, 2015 07:43
@fritzvd

fritzvd commented Dec 3, 2015

Copy link
Copy Markdown
Contributor Author

I adjusted this a bit. I'm not sure if this is something everyone wants.

At the moment I'm not sure how to pass through a JSONObject as json in JS but maybe someone can help. I guess it could be more efficient than making a JSONObject passing it as .toString() and then parsing it again in JS 😉

@nirre7

nirre7 commented Jan 18, 2016

Copy link
Copy Markdown

+1

Was just about to crete a pull request when I realized that atm one can't pass for example some metadata to the NativeScript app, which I need. One only seems to get the "message".

@nirre7

nirre7 commented Jan 21, 2016

Copy link
Copy Markdown

Hi again.

Just wanted to elaborate why I think this is important.

What I think is needed is a way of letting the app know that it is suppose to fetch a new "object" from the backend. In my previous project we have implemented that with the push functionality, either via "silent" pushes i.e not notifying the user or notification and db update (in the background) so that when the user starts/activates the app they will have update information from the backend.

As I understand it we can't achieve this given that the whole "object" isn't passed to the callback? Since it seems that this implementation is more geared towards the actual message that is being displayed.
Please correct me if I'm missing something.

Thanks in advance
Niclas

@fritzvd

fritzvd commented Jan 21, 2016

Copy link
Copy Markdown
Contributor Author

Hi Niclas,

That's what I thought. The whole point of the GCM was that you can also send extra information about what is updated etc, or the source. (e.g. someone sends message you want to send message back). But now that can almost solely be done by parsing the message or thinking of some other round about way.

What I tried in my pull request to push through the whole object. And for me it's working (I built it and am using my version of the plugin). The extra info is all coming through. Then after that it's up to the developer what he/she is going to with it, right?

Fritz

@r0bot

r0bot commented Jan 21, 2016

Copy link
Copy Markdown
Contributor

+1
Changes will be moved to a new PR to a different branch. See PR #11.

@r0bot r0bot closed this Jan 21, 2016
@fritzvd
fritzvd deleted the fritzvd/extra-parameters-for-callback branch January 21, 2016 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants