Not receiving any Parse Push whatsoever - android

I've followed every step outlined on Parse.com. I was first attempting to use a custom BroadcastReceiver (subclassing ParsePushBroadcastReceiver), but even without so, Parse Push doesn't seem to work. Here is a look at my AndroidManifest.xml (snippet just before closing <application> tag):
<!-- For 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="my.package.name" />
</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>
...and right before I open the <application> tag:
<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.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature"
android:name="my.package.name.permission.C2D_MESSAGE" />
<uses-permission android:name="my.package.name.permission.C2D_MESSAGE" />
I have tried pushing in all sorts of combinations, but absolutely no push seems to be going through.
All help greatly appreciated! :-)

Well I'll be arsed! Here's how I got it to work. First off, I switched to using the code in the Parse Push QuickStart guide for Android instead of an outdated tutorial by Parse. At the end of 4 wasted hours, I now see that an essential WAKE_LOCK permission is left out of the tutorial (Ikr?). (Presumably) More importantly, here's the change that seems to fix it, cerebral assassin as it may be - in your Application class:
public void onCreate() {
Parse.enableLocalDatastore(getApplicationContext());
Parse.initialize(this, "fo00", "b4r");
ParseFacebookUtils.initialize(this);
ParseInstallation.getCurrentInstallation().saveInBackground();
super.onCreate(); // Moved this from right at the top, to right at the bottom
}

Related

OUTDATED DEVICE: Parse Push Notification to Android devices

Hi have worked with parse for saving data. But notification is something i am stuck with. I am not able figure out what's going wrong.
I have done all the receiver registrations and so my device also gets registered in the installation table but while sending push from web console it says "push sent 0" looking into the description of each push it shows that "OUTDATED DEVICE - The records on this installation are outdated, the user might have uninstalled the app." But I just did the registration.
I am going mad with this...no clue in what am I doing wrong, I am using eclipse IDE, Can anyone please suggest me any Solution??
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.parsecomlogin"
android:versionCode="1"
android:versionName="1.0" >
<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.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.example.parsecomlogin.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.parsecomlogin.permission.C2D_MESSAGE" />
<permission
android:name="com.example.parsecomlogin.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.parsecomlogin.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<application
android:name=".ParseApp"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Added for Parse push notifications -->
<!-- My custom receiver -->
<receiver
android:name=".ParseReceiver"
android:enabled="true"
android:exported="false" >
<intent-filter>
<action android:name="com.example.parsecomlogin.RECEIVE_PUSH" />
</intent-filter>
</receiver>
<!-- END my custom receiver -->
<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.parsecomlogin" />
</intent-filter>
</receiver>
<activity
android:name=".Welcome"
android:label="#string/title_activity_welcome" >
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_login" >
</activity>
<activity
android:name=".LoginSignupActivity"
android:label="#string/title_activity_login_signup" >
</activity>
<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="AIzaSyDZ5TG28QJnN5zMyIdezPllvrfrwg7ElQs" />
</application>
</manifest>
I faced exactly the same problem and I fixed it a few minutes ago by coincidence. I hope the problem can be solved with the same touch-up for you as well.
In my situation, I used one of the older projects I worked and I have changed manifest package name manually in a way. In AndroidManifest.xml file, the manifest package name was changed to "com.myprojectname". There was no problem and app can run without any error with this package name. Also, all of Parse features run problem-free except push notification service. Then I checked other paths with Ctrl + Shift + R and searched whether R.java uses the same name. Unsurprisingly, the package name was identical in this file but I realized that in the lines below R.java uses the pattern of "net.myprojectname.app" instead of "com.myprojectname". I replaced "com.myprojectname" with "net.myprojectname.app" in all files by using Ctrl + Shift + R again. I think it was not the cause of the problem but I tried to send a last push notification desperately. It is hard to believe but it is worked. I got the notification successfully after all.
I answered the question in a highly informal and non-technical way but I have no idea about the underlying cause, I just want to help. Maybe it works for you. Good luck.

Push notification to all users after record is inserted in database

I am new to android, I am making an app which is installed by n users. When they add a new record in the database I would like to notify all users who has installed the app with,"[user] added a new comment [data]".
I tried to use parse sdk,like onCreate I added,
public void onCreate() {
Parse.initialize(this, "aaaa", "bbbb");
ParseInstallation.getCurrentInstallation().saveInBackground();
}
Also I changed the xml file and added,
<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" />
<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>
and some other as stated in the website. But I have to manually go to the parse website and "create push" and send to all. But I want to make it automatic. Like whenever a new message is inserted, push it. How can I achieve it programmatically.

Parse GCM push notifications not working on Android 6.0 Marshmallow Developer Preview 3

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.

Cannot receive push notification from parse.com

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!!

Parse.com - Push Notifications configuration problems in Android

I am trying to setup Parse.com push notifications as per the documentation:
My manifest xml has following related entries:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hello.world"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
....
<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" />
<!-- NOTE THIS NEXT LINE -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.hello.world.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.hello.world.permission.C2D_MESSAGE" />
....
<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.hello.world" />
</intent-filter>
</receiver>
</application>
After adding the parse.com push related configurations in manifest as above - The application has stopped working - it simply hangs on startup, i do not see the first screen.
EDIT 1
After debugging i found that application hangs here when it tries to make the first call to Parse:
ParseQuery<ParseObject> query = ParseQuery.getQuery("myclass");
List<ParseObject> myclassresult = query.find();//App Hangs at THIS line
Why would this happen only when Parse.com push configurations are added?
This line and App works fine without Parse.com push configs
(Also note that i have not done any specific configuration at Parse.com for the application to enable Push, and i am using the normal Parse.com sdk, not any special sdk for push notifications)
EDIT 2
When i look at the relevant Threads (AsyncTask#1) Stack Trace i see the following:
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:364)
at bolts.Task.waitForCompletion(Task.java:119)
at com.parse.Parse.waitForTask(Parse.java:721)
at com.parse.ParseUser.getCurrentUser(ParseUser.java:1044)
at com.parse.ParseQuery.getUser(ParseQuery.java:298)
at com.parse.ParseQuery.findInBackground(ParseQuery.java:892)
at com.parse.ParseQuery.find(ParseQuery.java:529)
at com.hello.world.MyQueryClass.getDataFromParse(MyQueryClass.java:..)
...
The solution was to uninstall and then install the application again.
Just re-installing on top of existing application was not working - and instead causing the odd behavior!
If anyone knows the reason for this - please post a comment.

Categories

Resources