Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show multiple lines in push notification android Phonegap

Im suffering from a problem in notification. Im doing my project in PHONEGAP. I want to show multiple lines in push notification in android. Now i am only getting single line notification. i cannot expand or do anything with that notification. im using a phonegap plugin.

com.phonegap.plugins.PushPlugin

Please help me to overcome this problem. Screen shot is given below.

Current Notification enter image description here

Expected Notification

like image 524
Dino Avatar asked Mar 18 '23 16:03

Dino


1 Answers

This involves a custom layout in the native notification (remoteviews) , so it is needed to modify you favorite plugin

Android custom notification layout with RemoteViews

In case of this plugin: https://github.com/phonegap-build/PushPlugin

  1. Modify GCMIntentService.java, particulary NotificationCompat.Builder setContent with a the custom View. This custom view can be loaded from xml or instatiated by code: How to create a RelativeLayout programmatically with two buttons one on top of the other?

Example of a custom builder: Create custom notification, android

  1. Change the params for the plugin or parse payload message to separate lines
like image 82
malcubierre Avatar answered Apr 25 '23 07:04

malcubierre