I have downloaded a Xamarin.Android push notification sample project from Parse.com, and it works when application is in foreground or minimized. If I kill application from Recent Applications screen the application will not show the future notifications.
My manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.parse.parsexamarinpushsample" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature" android:name="com.parse.parsexamarinpushsample.permission.C2D_MESSAGE" />
<uses-permission android:name="com.parse.parsexamarinpushsample.permission.C2D_MESSAGE" />
<application android:name="parsexamarinpushsample.ParseApplication" android:label="ParseXamarinPushSample" android:icon="@drawable/Icon" android:theme="@android:style/Theme.Light">
<receiver android:name="parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.parse.parsexamarinpushsample" />
</intent-filter>
</receiver>
<service android:name="parse.ParsePushService" />
</application>
My Code:
public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
{
ParseClient.Initialize("appid", "clientid");
ParsePush.ParsePushNotificationReceived += ParsePush.DefaultParsePushNotificationReceivedHandler;
ParsePush.ParsePushNotificationReceived += ParsePushOnParsePushNotificationReceived;
ParseInstallation installation = ParseInstallation.CurrentInstallation;
installation.SaveAsync();
return StartCommandResult.Sticky;
}
After sending notification i noticed on Parse Dashboard that notification is marked as "Successful" so I have a reason to believe that my phone is receiving the notification but there is no application that can handle it.
Do i need some intent action for broadcast receiver or something is wrong with my manifest?
Thanks in advance