package com.sharefaith.thesharefaithapp.base;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;


public class GcmBroadcastReceiver extends BroadcastReceiver
{
    /**
     *
     * @param context
     * @param intent
     */
    @Override
    public void onReceive( Context context, Intent intent )
	{
        // Explicitly specify that GoogleCloudMessaging will handle the intent.
        ComponentName comp = new ComponentName( context.getPackageName(), GcmIntentService.class.getName() );

        // Start the service, keeping the device awake while it is launching.
        GcmIntentService.enqueueWork( context, (intent.setComponent( comp )) );
        setResultCode( Activity.RESULT_OK );

        // System.out.println( "GcmBroadcastReceiver Received A Push!: " + intent.toString() );
    }
}