Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Same data payload for messages with action buttons #90

Closed
mauron85 opened this issue Aug 31, 2015 · 5 comments
Closed

Same data payload for messages with action buttons #90

mauron85 opened this issue Aug 31, 2015 · 5 comments
Labels

Comments

@mauron85
Copy link

Everytime I send message:

{
    priority: 'high',
    timeToLive: 3000, // Duration in seconds to hold in GCM and retry before timing out. Default 4 weeks (2,419,200 seconds) if not specified.
    data: {
        title: 'title'
        message: 'message',
        trackingNr: 'AZ-12312312312',
        actions: [
            { icon: 'accept', title: 'INTERESTED', callback: 'app.accept},
            { icon: 'deny', title: 'NOT INTERESTED', callback: 'app.deny'},
        ]
    }
}

where trackingNr is kind of UUID

In app.accept callback handler I get same msg.additionaData.trackingNr , meaning if i send first message with trackingNr='AZ-12312312312' all following message have msg.additionalData.trackinNr === 'AZ-12312312312', until I restart the app.

window.app = {};
app.accept = function (msg) {
    console.log('[DEBUG] job accepted', msg);
};
@mauron85
Copy link
Author

This is the actual message (received by app.accept handler) which is always the same (repeatedly), even though in android notification area the messages are displayed correctly.

{
    "callback": "app.accept",
    "title": "New job offer",
    "message": "Vajnorská ulica 100,831 04 Bratislava\nEgrešová 9, Bratislava 2",
    "additionalData": {
        "actions": [{
            "icon": "accept",
            "callback": "app.accept",
            "title": "INTERESTED"
        }, {
            "icon": "deny",
            "callback": "app.deny",
            "title": "NOT INTERESTED"
        }],
        "from": "556707696232",
        "trackingNr": "AD-55e45808a8f243358c16dc56",
        "coldstart": false,
        "collapse_key": "do_not_collapse",
        "foreground": false
    }
}

@macdonst
Copy link
Member

I'm so embarrassed, fixed now. Pushed 1.2.2.

@mauron85
Copy link
Author

mauron85 commented Sep 1, 2015

Thank you, works like charm now ;-)

@macdonst
Copy link
Member

macdonst commented Sep 1, 2015

@mauron85 great to hear. Keep logging issues if you find stuff. Still ticked at this dumb mistake.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants