Hello,
I have been trying to make custom buttons for Interactive Notifications, but it's not working and I can't figure out why. I have done everything the doc says (http://docs.urbanairship.com/platform/android.html#interactive-notifications), and tried some tricks, but it sill not working. Here is my code :
public class NayshowApp extends Application {
@Override
public void onCreate() {
super.onCreate();
UAirship.takeOff(this, new UAirship.OnReadyCallback() {
@Override
public void onAirshipReady(UAirship airship) {
// Enable user notifications
airship.getPushManager().setUserNotificationsEnabled(!Utils.getPrefBooleanDefaultFalse(NayshowApp.this, Constants.NOTIFICATIONS, Constants.NOTIFICATIONS_DISABLED));
}
});
NotificationActionButton hiButtonAction = new NotificationActionButton.Builder("hi")
.setLabel(R.string.label_headline)
.setIcon(R.drawable.image_error)
.setPerformsInForeground(true)
.build();
NotificationActionButton byeButtonAction = new NotificationActionButton.Builder("bye")
.setLabel(R.string.label_no_result)
.setIcon(R.drawable.ns_icon)
.setPerformsInForeground(true)
.build();
// Define the group
NotificationActionButtonGroup buttonGroup = new NotificationActionButtonGroup.Builder()
.addNotificationActionButton(hiButtonAction)
.addNotificationActionButton(byeButtonAction)
.build();
// Add the custom group
UAirship.shared().getPushManager().addNotificationActionButtonGroup("custom group", buttonGroup);
}
}
Then I set up my notification with eveything except with the buttons because I custom them in my code : http://i.imgur.com/3JcOsAw.png
And it does not work, the notification has no button. And I really do not understand how I could make it work.
Thanks for your help !
Comments
4 comments