eu.easypush.pushlibrary.activities.PushActivity Maven / Gradle / Ivy
package eu.easypush.pushlibrary.activities;
import org.json.JSONObject;
import android.app.Activity;
import android.os.Bundle;
import eu.easypush.pushlibrary.constants.EasyPushConstants;
import eu.easypush.pushlibrary.utils.PushUtils;
public class PushActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getIntent() != null && getIntent().getExtras() != null) {
if (getIntent().getExtras().getString(EasyPushConstants.EZ_MESSAGE) != null) {
try {
String message = getIntent().getExtras().getString(
EasyPushConstants.EZ_MESSAGE);
JSONObject object = new JSONObject(message);
if (object.optString(EasyPushConstants.EZ_MESSAGE_READ_ID,
null) != null) {
PushUtils
.setMessageRead(
this,
object.getString(EasyPushConstants.EZ_MESSAGE_READ_ID));
}
} catch (Throwable t) {
}
}
}
}
}