/PushSharp.Client/PushSharp.Client.MonoForAndroid.Gcm/GCMBroadcastReceiver.cs
C# | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 99f5bb11a2521d3b56026d9b4cb8f643 MD5 | raw file
Possible License(s): Apache-2.0
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Android.App;
- using Android.Content;
- using Android.OS;
- using Android.Runtime;
- using Android.Views;
- using Android.Widget;
- using Android.Util;
- namespace GCMSharp.Client
- {
- public class GCMBroadcastReceiver<TIntentService> : BroadcastReceiver where TIntentService : GCMBaseIntentService
- {
- const string TAG = "GCMBroadcastReceiver";
- public override void OnReceive(Context context, Intent intent)
- {
- Log.Verbose(TAG, "OnReceive: " + intent.Action);
- var className = context.PackageName + GCMConstants.DEFAULT_INTENT_SERVICE_CLASS_NAME;
- Log.Verbose(TAG, "GCM IntentService Class: " + className);
- GCMBaseIntentService.RunIntentInService(context, intent, typeof(TIntentService));
- SetResult(Result.Ok, null, null);
- }
- }
- }