I'm using parse for sending notifications .I wrote this code and it works find on emulator but I get the notifications on phones . this is the manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="mypackagename.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.parse.starter.permission.C2D_MESSAGE" />
<uses-permission android:name="mypackagename.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:name="mypackagename.ParseApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light">
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
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" />
<!-- IMPORTANT: Change "com.parse.tutorials.pushnotifications" to match your app's package name. -->
<category android:name="mypackagename.MessageAll" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<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" />
</intent-filter>
</receiver>
<receiver
android:name="mypackagename.MessageAll"
android:exported="false">
<intent-filter>
<action android:name="mypackagename.MessageAll" />
<action android:name="MessageAll" />
</intent-filter>
</receiver>
for mypackagename I use my package name .
in the parseApplication :
import com.parse.Parse;
import com.parse.PushService;
public class ParseApplication extends android.app.Application {
public ParseApplication() {
}
#Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, "9OaXWT76IDHlZiwQVaGwECw7LISflGmLmDJf0VTa", "0JcMfXSQPn2oJpH6x8qR2gJhG41U17nVOXOWmIIK");
PushService.setDefaultPushCallback(this, FistActiivty.class);
}
}
I've changed these two values with new codes from parse keys .
when I debug it on the phone ,I get this message:
com parse PushService: Tried to use push, but this app is not configured for push due to: Push is not configured for this app because the app manifest is missing required declarations. Please add the following declarations to your app manifest to support either GCM or PPNS for push (or both). To enable GCM support, please make sure that these permissions are declared as children of the root <manifest> element:
what is wrong ? I don't get it .
Related
There's been a couple of posts on this topics, but they haven't been helpful for me.
Here are my permissions:
<uses-feature android:name="android.hardware.camera" android:required="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_TASKS"/>
<permission android:protectionLevel="signature" android:name="com.package.name.permission.C2D_MESSAGE" />
<uses-permission android:name="com.package.name.permission.C2D_MESSAGE" />
Other stuff:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.package.name.PushReceiver" android:exported="false">
<intent-filter>
<action android:name="com.mobiquity.which.VOTE_REQUEST" />
<action android:name="com.mobiquity.which.VOTE_HAPPENED" />
<action android:name="com.mobiquity.which.QUESTION_COMPLETE" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
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" />
<!-- app package -->
<category android:name="com.package.name" />
</intent-filter>
</receiver>
Anyone spot anything wrong or missing?
SOLUTION: I was missing these two permissions:
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Rumor has it you may not need GET_ACCOUNTS FOR above 4.0 & 4.1
Several causes for this issue but you are talking about loading the same .apk into the emulator and the device.
Got to
Settings -> Application manager -> go to the app and check if Show notifications is enabled.
In version 1.11.0 they removed the GET_ACCOUNTS permission.
Check the release notes.
I have registered the necessary permissions, services, and broadcast receivers in my AndroidManifest.xml and I have Parse push notifications working on pre Android M devices. I am getting an error (posted below) in the Android 6.0 Marshmallow Developer Preview 3 running on my Nexus 5. The user is successfully registering and I can view it in the Parse dashboard on Parse.com, but the pushType and deviceLastTokenModified are undefined. I can't help but think this is an issue with the Parse SDK considering this is working fine on Pre Android M devices. It could be an issue with Android M's permission changes, except none of the permissions I am requesting fall under the category that ask the user to grant it.
Here is the error::
08-30 19:29:19.671 11848-11848/com.example.app V/com.parse.ManifestInfo﹕ Cannot use GCM for push because the app manifest is missing some required declarations. Please make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.richardlucasapps.eaglescribe.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.richardlucasapps.eaglescribe.permission.C2D_MESSAGE" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver" 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.richardlucasapps.eaglescribe" />
</intent-filter>
</receiver>
08-30 19:29:19.671 11848-11848/com.example.app V/com.parse.ManifestInfo﹕ Using none for push.
Here is how I am initializing Parse and setting it up for push notifications:
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
Parse.initialize(this, applicationId, clientId);
ParseUser.enableAutomaticUser();
ParseUser.getCurrentUser().increment("RunCount");
ParseUser.getCurrentUser().saveInBackground();
ParseInstallation parseInstallation = ParseInstallation.getCurrentInstallation();
parseInstallation.put("user", ParseUser.getCurrentUser());
parseInstallation.saveInBackground()
}
}
Here is a condensed version of my AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.app” >
<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.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!--
IMPORTANT: Change "com.parse.starter.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
<permission
android:name="com.example.app.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.app.permission.C2D_MESSAGE" />
<application
android:name=".global.MyApplication">
<!-- For Parse Notification Push Service -->
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false" >
<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" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
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.example.app” />
</intent-filter>
</receiver>
</application>
Update the Parse library you are using in your project. I was using 1.9.4 and updated to Parse 1.10.1 and now my Android Marshmallow device is successfully registering for and receiving push notifications.
Grab the most up to date Parse library here.
Error : Device token Field always null in Parse Installation table.
code
java
ParseInstallation.getCurrentInstallation().saveInBackground();
ParsePush.subscribeInBackground(AppConfig.PARSE_CHANNEL, new SaveCallback() {
#Override
public void done(ParseException e) {
Log.e(TAG, "Successfully subscribed to Parse!");
}
});
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dev.leapup" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<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" />
<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
<permission android:protectionLevel="signature"
android:name="com.dev.leapup.pushnotifications.permission.C2D_MESSAGE" />
<uses-permission android:name="com.dev.leapup.pushnotifications.permission.C2D_MESSAGE" />
<application
android:name=".application.LeapUpApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".services.LeapUpService"
android:exported="false" >
</service>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
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" />
<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications" to match your app's package name.
-->
<category android:name="com.dev.leapup.pushnotifications" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<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" />
</intent-filter>
</receiver>
<!-- replace #drawable/push_icon with your push icon identifier -->
<meta-data android:name="com.parse.push.notification_icon" android:resource="#drawable/ic_launcher"/>
</application>
Interesting fact is if use same java code in another project it works, generate the devicetoken. what is the reason, not generating devicetoken for this project , manifest problem?? anything need to change manifest? please help me.
your package name appears to be "com.dev.leapup" however you are incorrectly entering it as "com.dev.leapup.pushnotifications" in your manifest.
as per the comment from Parse
<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" in the lines below
to match your app's package name + ".permission.C2D_MESSAGE".
-->
You should install Google App for having device-token in your device...
it helped me with old devices and genymotion emulator....
see tutorial on Github
see answer on StackOverFlow
Hope this will helps you and others...
following the parse.com tutorial for setting up push notification on android (https://parse.com/tutorials/android-push-notifications). but getting below error:
03-16 14:36:15.280 19899-19952/experties.com.handytask E/com.parse.PushService﹕ Tried to use push, but this app is not configured for push due to: Push is not configured for this app because the app manifest is missing required declarations. Please add the following declarations to your app manifest to support either GCM or PPNS for push (or both). To enable GCM support, please make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="experties.com.handytask.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="experties.com.handytask.permission.C2D_MESSAGE" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver" 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="experties.com.handytask" />
</intent-filter>
</receiver>
To enable PPNS support, please make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
My AndroidManifest.xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="experties.com.handytask" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<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="experties.com.handytask.permission.C2D_MESSAGE" />
<uses-permission android:name="com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<application
android:name=".rest.HandyTaskApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".activities.LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.ShowTasksActivity"
android:label="#string/title_activity_show_tasks" >
</activity>
<activity
android:name=".activities.ChatActivity"
android:label="#string/title_activity_chat" >
</activity>
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBFgfG5NRhQj_nC0aFRi7PAyruYG3lbJdg" />
<activity
android:name=".activities.TaskCreationStep1Activity"
android:label="#string/title_activity_task_created" >
</activity>
<activity
android:name=".activities.TaskCreationStep2Activity"
android:label="#string/title_activity_task_creation_step2" >
</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
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="experties.com.handytask" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<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" />
</intent-filter>
</receiver>
<meta-data android:name="com.parse.push.notification_icon" android:resource="#drawable/push_icon"/>
</application>
</manifest>
Please suggest what am I doing wrong here?
I refer this posts too, but didn't help.
Android: How to use Parse as an alternative GCM push notification provider?
error setting up push notification using parse.com and android studio
Looking at your manifest, file, I think the problem lies in the following line:
<uses-permission android:name="com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" />
You need to change com.parse.tutorials to match your app's package name + ".permission.C2D_MESSAGE"
In your case, this would be
<uses-permission android:name="experties.com.handytask.permission.C2D_MESSAGE" />
Basically, your android:name and uses-permission has to match.
I have implemented what parse.com had in their tutorial and when I send a push from parse dashboard it says Succeeded but the number of pushes sent is 0. However whenever I want to send the push it says recepient 1 which means it recognizes my device. I did what it says in this link but it doesnt work:
I can't receive push notifications in app from Parse
I'm very confused why I'm not receiving any notification here is my Application class code:
Parse.initialize(this, "xxxxx", "xxxxx");
ParseInstallation.getCurrentInstallation().saveInBackground();
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
ParsePush.subscribeInBackground("", new SaveCallback() {
#Override
public void done(ParseException e) {
if (e == null) {
Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
} else {
Log.e("com.parse.push", "failed to subscribe for push", e);
}
}
});
here is my manifest permission:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission android:name="com.myapp.main.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.main.permission.C2D_MESSAGE" />
and here is the rest of manifest related to parse push:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver" 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.myapp.main" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<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" />
</intent-filter>
</receiver>
<!-- replace #drawable/push_icon with your push icon identifier -->
<meta-data android:name="com.parse.push.notification_icon" android:resource="#drawable/applogo"/>
EDIT: Here is the log:
02-25 13:52:53.681 4636-4653/com.myapp.main E/com.parse.ManifestInfo﹕ Cannot use GCM for push because the app manifest is missing some required declarations. Please make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<permission android:name="com.myapp.main.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.main.permission.C2D_MESSAGE" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver" 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.myapp.main" />
</intent-filter>
</receiver>
02-25 13:57:13.004 5598-5598/com.myapp.main E/com.parse.PushService﹕ Tried to use push, but this app is not configured for push due to: Push is not configured for this app because the app manifest is missing required declarations. Please add the following declarations to your app manifest to support either GCM or PPNS for push (or both). To enable GCM support, please make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.myapp.main.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.main.permission.C2D_MESSAGE" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.GcmBroadcastReceiver" 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.myapp.main" />
</intent-filter>
</receiver>
To enable PPNS support, please make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
02-25 14:12:25.534 10046-10046/com.myapp.main E/com.parse.push﹕ successfully subscribed to the broadcast channel.
android:name="com.myapp.main.permission.permission.C2D_MESSAGE"
Can you change it to have only one "permission" in the name?
I changed my manifest to this:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<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" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver" 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" />
<!--
IMPORTANT: Change "com.parse.starter" to match your app's package name.
-->
<category android:name="com.vitrin.main" />
</intent-filter>
</receiver>
I still get that error + :
02-25 15:44:33.042 32710-32710/com.myapp.main E/com.parse.PushService﹕ PushService somehow started even though this device doesn't support push.
02-25 15:44:33.042 32710-32710/com.myapp.main E/com.parse.PushService﹕ Started push service even though no push service is enabled: Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10 pkg=com.myapp.main cmp=com.myapp.main/com.parse.PushService (has extras) }
02-25 15:45:10.508 32710-32710/com.myapp.main E/com.parse.PushService﹕ Started push service even though no push service is enabled: Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10 pkg=com.myapp.main cmp=com.myapp.main/com.parse.PushService (has extras) }
but for some reason it is working!!