private Object createAlertObject() {
if (this.hasAlertContent()) {
if (this.shouldRepresentAlertAsString()) {
return this.alertBody;
} else {
final JSONObject alert = new JSONObject();
if (this.alertBody != null) {
alert.put(ALERT_BODY_KEY, this.alertBody);
}
if (this.showActionButton) {
if (this.localizedActionButtonKey != null) {
alert.put(ACTION_LOC_KEY, this.localizedActionButtonKey);
}
} else {
// To hide the action button, the key needs to be present, but the value needs to be null
alert.put(ACTION_LOC_KEY, null);
}
if (this.localizedAlertKey != null) {
alert.put(ALERT_LOC_KEY, this.localizedAlertKey);
if (this.localizedAlertArguments != null) {
final JSONArray alertArgs = new JSONArray();
for (final String arg : this.localizedAlertArguments) {
alertArgs.add(arg);
}
alert.put(ALERT_ARGS_KEY, alertArgs);
}
}
if (this.launchImageFileName != null) {
alert.put(LAUNCH_IMAGE_KEY, this.launchImageFileName);
}
return alert;
}
} else {