Commit d3e21a2d authored by d4vidi's avatar d4vidi

Slightly refactor PushNotification to allow for easier overriding (aligns with wiki)

parent 40d2b6fc
......@@ -38,7 +38,8 @@ public class PushNotification implements IPushNotification {
}
@Override
public void onAppNotVisible() {}
public void onAppNotVisible() {
}
};
protected PushNotification(Context context, Bundle bundle, AppLifecycleFacade appLifecycleFacade) {
......@@ -127,15 +128,17 @@ public class PushNotification implements IPushNotification {
}
protected Notification buildNotification(PendingIntent intent) {
final Notification.Builder notificationBuilder = new Notification.Builder(mContext)
return getNotificationBuilder(intent).build();
}
protected Notification.Builder getNotificationBuilder(PendingIntent intent) {
return new Notification.Builder(mContext)
.setContentTitle(mNotificationProps.getTitle())
.setContentText(mNotificationProps.getBody())
.setSmallIcon(mContext.getApplicationInfo().icon)
.setContentIntent(intent)
.setDefaults(Notification.DEFAULT_ALL)
.setAutoCancel(true);
return notificationBuilder.build();
}
protected void postNotification(int id, Notification notification) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment