Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Rich Push Notification #2208
Codename One should support high-level customization of push notification on iOS and Android. Currently, the only push that could be sent is basic.
Some of the features that can be added are:
Examples of some of these features can be found below:
Custom actions and image attachments have been added. See
I have not added:
I don't know what "Adding a frame to push content." is referring to.
NOTE: Image attachment support requires an additional provisioning profile to be generated. The certificate wizard will generate this automatically and make it available to the build server during builds - but you'll need to generate new provisioning profiles for your app (using the certificate wizard) to trigger this.
added a commit
Aug 2, 2018
Status update: Test input is implemented in iOS, but not in Android yet. I have run into some difficulty getting android to work properly. Will take another shot at it soon.
I don't think I'm going to include the "Different text when expanded" in this RFE. It may be best handled natively.
added a commit
Jan 31, 2019
I have finally added support for text replies as part of a push notification on Android. This completes this issue.
The app main class should implement PushActionProvider. It will define a method that returns a set of categories. E.g.
Then, when sending a push notification, you can specify the "category" of the message. If the category corresponds with a defined category in your getPushActionCategories() method, then the user will be presented with a set of buttons corresponding to the PushActions in that category.
In the above example, we would send a push type 99 and a body of
This would trigger the "fo" category that we defined, which has 3 actions: Yes, No, and Maybe. And the "Maybe" action will provide a text input because of the extra parameters provided:
The last 2 parameters are the "hint" text and the reply button label. On android, the notification will look like
If you click on "Maybe" (with API 27 or higher), then you'll get a text field to enter a reply directly.
You can retrieve both which action was pressed, and what the user text input was using the PushContent class.
An example push callback method to retrieve this data: