How te set action buttons in raix:push notification?


#1

Hai anybody know how to implement action buttons in raix:push notification?


#2

raix:push doesn’t support action buttons at the moment. But it should be simple to create a fork to fix that :slight_smile:

Look at line 310 here: push.api.js
I think all you need to do is add data.actions = notification.actions

Then you can follow the phonegap-plugin-push guide


#3

Thanks herteby.
This is my sample code for Meteor.methods({
‘pushnotification’: function (value){
Push.send({
from: ‘Test’,
title: ‘test’,
text: 'test,
badge: 1,
query: {
userId: {users}
}
payload :{
“registration_ids”: [“my device id”],
“data”: {

    "actions": [
        { "icon": "emailGuests", "title": "EMAIL GUESTS", "callback": "app.emailGuests", "foreground": true},
        { "icon": "snooze", "title": "SNOOZE", "callback": "app.snooze", "foreground": false}
    ]
}

}

});

}
})

Is this code right?
Which version of raix:push and phonegap-plugin-push will be use?


#4

I think “data” should be “gcm” (where you put all your android-specific things).
Get the latest (3.1.0-pre.1) build of raix:push from github and make your modification.
Just check its package.json to see what version of plugin-push it depends on:

Cordova.depends({
  'phonegap-plugin-push': '1.6.4', // 1.3.0
  'cordova-plugin-device': '1.1.1',
});

#5

Thanks herteby.
I used cordova-plugin-device@1.1.3,
phonegap-plugin-push@1.3.0
and raix:push@3.0.3.rc.7


#6

I would love an example as to how to setup actions on raix:push. I tried to follow the instructions mentioned in this thread, but could not get it working. I’m attempting to do it on Android.

Edit: Also I’d like to clarify - I don’t understand how to use Github properly. I have been trying to “fork” this and make the change so that it will remain changed in my meteor folder for hours but cannot figure it out. I clicked EDIT on github and made the change to line 310 as you mentioned, but every time I rebuild meteor it goes away.


#7

Is there anything interesting on this topic? Happened?


#8

Hi @herteby,
I forked raix:push and made the changes you had said above. But I am stuck at one point, how do you Build raix:push? They have not given any documents regarding build process. How do I test my changes? Any answer on this would be appreciated.

Thanks,
Shivang