Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigTextStyle for notification #541

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads"
id="com.phonegap.plugins.PushPlugin"
version="2.2.1">
id="com.clavei.phonegap.plugins.PushPlugin"
version="2.2.7">

<name>PushPlugin</name>
<author>Bob Easterday</author>
Expand Down
16 changes: 9 additions & 7 deletions src/android/com/plugin/gcm/GCMIntentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,25 @@ public void createNotification(Context context, Bundle extras)
} catch (NumberFormatException e) {}
}


String message = extras.getString("message");
if (message == null) {
message = "<missing message content>";
}

NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(context)
.setDefaults(defaults)
.setSmallIcon(context.getApplicationInfo().icon)
.setWhen(System.currentTimeMillis())
.setContentTitle(extras.getString("title"))
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(message))
.setTicker(extras.getString("title"))
.setContentText(message)
.setContentIntent(contentIntent)
.setAutoCancel(true);

String message = extras.getString("message");
if (message != null) {
mBuilder.setContentText(message);
} else {
mBuilder.setContentText("<missing message content>");
}

String msgcnt = extras.getString("msgcnt");
if (msgcnt != null) {
mBuilder.setNumber(Integer.parseInt(msgcnt));
Expand Down