0

I am aware that this question has been asked earlier, but I have tried all the things including the tutorial provided on parse.com.

So I am trying to send notification using parse web console. But I am unable to do so, in web console it is showing that notification has been sent to 0 device.

So here is the code snippet: In my main activity

Parse.initialize(this, "ABC", "XYZ");
PushService.setDefaultPushCallback(this, TodoListActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();

In my AndroidManifest.xml

permission:

<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" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission
 android:name="com.parse.offlinetodos.permission.C2D_MESSAGE"
 android:protectionLevel="signature" />
<uses-permission android:name="com.parse.offlinetodos.permission.C2D_MESSAGE" />

service and reciever part:

<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.starter" to match your app's package name. -->
 <category android:name="com.parse.offlinetodos" />
 </intent-filter>
</receiver>

From the console, I am just trying to send a plain text push notification.

Please help me out, what am I missing ?

Roham Tehrani
3,0298 gold badges38 silver badges51 bronze badges
asked Nov 12, 2015 at 14:18

1 Answer 1

1

You need to put this

Parse.initialize(this, "ABC", "XYZ");
 PushService.setDefaultPushCallback(this, TodoListActivity.class);
 ParseInstallation.getCurrentInstallation().saveInBackground();

to another File which extends Application class

then on you manifest

<application
 android:name="com.package.ApplicationFileThatContainsTheParseKey">
... 
</application>
answered Nov 12, 2015 at 14:35
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.