All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.easypush.pushlibrary.activities.PushActivity Maven / Gradle / Ivy

There is a newer version: 0.8
Show newest version
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) {
				}
			}
		}

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy