- Home /
Parse push notification doesn't show
Hi,
For several days now, I'm trying to send push notifications from the parse system to my android device. I have read parse push notification guide and pepoles's questions and I just can't get this to work.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.moveosoftware.flappydragon"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<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.moveosoftware.flappydragon.permission.C2D_MESSAGE" />
<uses-permission android:name="com.moveosoftware.flappydragon.permission.C2D_MESSAGE" />
<application android:label="com.moveosoftware.flappydragon" android:icon="@drawable/app_icon">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.moveosoftware.flappydragon" />
</intent-filter>
</receiver>
<service android:name="com.parse.ParsePushService" />
</application>
</manifest>
My pushbehaviour settings:
void Awake() {
ParsePush.ParsePushNotificationReceived += (sender, args) => {
#if UNITY_ANDROID
AndroidJavaClass parseUnityHelper = new AndroidJavaClass("com.parse.ParseUnityHelper");
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("com.unity3d.player.UnityPlayerNativeActivity");
// Call default behavior.
parseUnityHelper.CallStatic("handleParsePushNotificationReceived", currentActivity, args.StringPayload);
#endif
};
and my installation setup:
void Start() {
//Parse Installation
if (ParseInstallation.CurrentInstallation != null && !string.IsNullOrEmpty(ParseInstallation.CurrentInstallation.DeviceToken))
{
Debug.Log("Device Token : " + ParseInstallation.CurrentInstallation.DeviceToken);
}
else
{
var installation = ParseInstallation.CurrentInstallation;
installation.Channels = new List<string> { "asxas" };
installation.SaveAsync().ContinueWith(t => {
if (t.IsFaulted || t.IsCanceled)
{
Debug.Log("Push subscription failed.");
}
else
{
Debug.Log("Push subscription success.");
}
});
//installation.
}
}
Sorry about my bad language and thank you for reading this. I will very appreciate your help
Comment
Your answer
Follow this Question
Related Questions
does unity 5.3 android sms billing status require configuration changes ? 0 Answers
Using Parse with Unity and the Parse Initialize Behavior is causing Android Device to crash 0 Answers
[URGENT!]Android Manifest file keeps reverting changes after build! 0 Answers
Wake lock for android 2 Answers
Auto Lunch Android app 0 Answers