Пример #1
0
  @Override
  protected void onPushReceive(Context context, Intent intent) {
    super.onPushReceive(context, intent);

    if (intent == null) return;

    try {
      JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
      description = json.optString("alert", null);
      parseIntent = intent;
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }
  @Override
  protected void onPushReceive(Context context, Intent intent) {
    super.onPushReceive(context, intent);

    if (intent == null) return;

    try {
      JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));

      Log.e(TAG, "Push received: " + json);

      parseIntent = intent;

      parsePushJson(context, json);

    } catch (JSONException e) {
      Log.e(TAG, "Push message json exception: " + e.getMessage());
    }
  }