I'm using a custom notification receiver class for parse.com push notifications to change the sound, vibration... sometimes, it looks to me that the notification did not arrives. I can see the push notification on the parse website as send. Maybe someone can review my code and see some wrong code pieces.
Manifest:
<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.mflapp.test" />
</intent-filter>
</receiver>
<receiver
android:name=".MyCustomReceiver"
android:exported="false" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>
MyCustomReceiver
public class MyCustomReceiver extends ParsePushBroadcastReceiver {
private static int NOTIFICATION_ID = 1;
protected void onPushReceive(Context mContext, Intent intent) {
try {
String action = intent.getAction();
String channel = intent.getExtras().getString("com.parse.Channel");
JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
if (action.equalsIgnoreCase("com.parse.push.intent.RECEIVE")) {
NOTIFICATION_ID++;
String title = mContext.getResources().getString(R.string.app_name);
if (json.has("alert"))
{
String text = json.getString("alert");
generateNotification(mContext, title, json, text);
}
}
} catch (JSONException e) {
}
}
private void generateNotification(Context context, String title, JSONObject json, String text) {
Intent intent = new Intent(context, home.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT);
NotificationManager mNotifM = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher))
.setAutoCancel(true)
.setContentTitle(title)
.setContentText(text)
.setStyle(new NotificationCompat.BigTextStyle().bigText(text))
.setTicker(text)
.setLights(Color.GREEN, 500, 500);
mBuilder.setContentIntent(contentIntent);
mNotifM.notify(NOTIFICATION_ID, mBuilder.build());
}
}
Aren't you missing an #Override note at all?
The signature of the method should be:
#Override
protected void onPushReceive(Context mContext, Intent intent)
When I have had problems with notifications, I have added a line:
android:name=".MyApplication" to the application tag in the Android manifest and it helped me.
Also I'm not sure that yours numerating system is good. When you relaunch app, counting starts from 1 again. I suppose that you are using notification id while showing it for users and now it didn't work.
Related
I have a problem and maybe a lot of people happens, well when I try to start activity defined in showNotification method in MyFireBaseMessagingService Class
Important: I config my aplication with shared preferences, IntroActivity(Splash) is showed just one time
Flow Initial: IntroActivity(Splash) -> MainActivity (In default Fragment Option in Navigation Drawer Menu)
Second Time run Application: MainActivity (In Default Fragment Option in Navigation Drawer Menu)
I show you my code, I'll really appreciate your help because I need fix this problem, if you need more information, just tell me.
Case I (Correct flow)
When I have application in background, the notification is displayed on taskbar, after I click the notification in top bar, the application is open in the specified activity DetailNoticiaEventoActivity with correct information.
Case II (Problem flow)
But when I close the application and finish it, the notification is displayed on taskbar, but when I click it, the application is open in MainActivity, and not showing the activity DetailNoticiaEventoActivity in first instance how I wanted
Case III (Problem flow)
Sometimes even though the application is in the background, the notification redirects me to the MainActivity
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pe.edu.usmp.fiausmp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<!-- SPLASH ACTIVITY -->
<activity
android:name="pe.edu.usmp.fiausmp.Activities.IntroActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- END SPLASH ACTIVITY -->
<!-- MAINACTIVITY WITH NAV DRAWER -->
<activity android:name="pe.edu.usmp.fiausmp.Activities.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- END MAINACTIVITY WITH NAV DRAWER -->
<!-- ACTIVITY SHOWED BY NOTIFICATION METHOD -->
<activity android:name="pe.edu.usmp.fiausmp.Activities.DetalleNoticiaEventoActivity"
android:theme="#style/AppTheme.NoActionBar"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- END ACTIVITY SHOWED BY NOTIFICATION METHOD -->
<!-- FIREBASE CLASS-->
<service android:name="pe.edu.usmp.fiausmp.Listeners.MyFireBaseMessagingService">
<intent-filter>
<action android:name= "com.google.firebase.MESSAGING_EVENT"></action>
</intent-filter>
</service>
<service android:name="pe.edu.usmp.fiausmp.Listeners.MyFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"></action>
</intent-filter>
</service>
<!-- END FIREBASE CLASS-->
</application>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"
/>
</manifest>
MyFireBaseMessagingService - showNotificationMethod()
This is my full class, I start a activity with Intent and set PendindIntent with this one. I use getNotification() for show notification on any device, and I use getData() for custom information like Ticker, BigTextStyle and Sound.
NOTE: The commented lines, reflects the solutions you tested with the opinions and suggestions of this publication
public class MyFireBaseMessagingService extends FirebaseMessagingService{
private static final String TAG = "FIA USMP";
int contador = 0;
#Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage == null){
return;
}
Log.e(TAG, "From: " + remoteMessage.getFrom());
Log.e(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
Log.e(TAG, "Notification Message Data: " + remoteMessage.getData());
if (remoteMessage.getData().size() > 0){
JSONObject json = new JSONObject(remoteMessage.getData());
sendNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody(), json);
}
}
//This method is only generating push notification
private void sendNotification(String title, String messageBody, JSONObject json) {
int cod_not_eve = 0;
String cod_mod = "";
String titulo = "";
String resumen = "";
String detalle = "";
try {
cod_not_eve = Integer.parseInt(json.getString("cod_not_eve"));
cod_mod = json.getString("cod_mod");
titulo = json.getString("titulo");
resumen = json.getString("resumen");
detalle = json.getString("detalle");
}catch (JSONException e){
Log.e(TAG, "JSONException: " + e.getMessage());
}catch (Exception e){
Log.e(TAG, "Exception2: " + e.getMessage());
}
Intent intent = new Intent(this, DetalleNoticiaEventoActivity.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("cod_not_eve", cod_not_eve);
intent.putExtra("cod_mod", cod_mod);
//PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
// PendingIntent.FLAG_ONE_SHOT);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
//PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
// PendingIntent.FLAG_UPDATE_CURRENT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
//.setLargeIcon(BitmapFactory.decodeResource(this.getResources(), R.mipmap.ic_launcher))
.setContentTitle(title)
.setContentText(messageBody)
//.setStyle(new NotificationCompat.BigTextStyle().bigText(detalle))
.setAutoCancel(true)
//.setVibrate(new long[] {0, 1000, 200,1000 })
//.setLights(Color.parseColor("#00BCD4"), 500, 500)
//.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
//.setTicker(titulo);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(contador, notificationBuilder.build());
Log.d("","MyFireBaseMessagingService.sendNotification.contador"+contador);
contador++;
}
}
Intent intent = new Intent(this, DetalleNoticiaEventoActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
What I've done:
I've done with the notification part, which is displaying multiple notification in notification tray without overriding it.
What I want to achieve:
I want to remove three dots(...) which are displayed after the 7th notification in data payload of notification tray. Just like in the 2nd image there are no continuation dots after 7th notification in WhatsApp. I've done lots of research but didn't found any feasible solution.
Image 1
Image 2
Below is my code:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fcmdemo">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/icon_btn_volume"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
android:name=".MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<receiver android:name="NotificationActionReceiver">
<intent-filter>
<action android:name="CONFIRM" />
<action android:name="CANCEL" />
</intent-filter>
</receiver>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/icon_btn_volume" />
<meta-data android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#color/colorAccent" />
</application>
</manifest>
MyFirebaseMessagingService.java
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = MyFirebaseMessagingService.class.getSimpleName();
public static ArrayList<String> notifications = new ArrayList<>();
private String remoteMSG;
#TargetApi(Build.VERSION_CODES.M)
#Override
public void onMessageReceived(RemoteMessage remoteMessage) {
//Log data to Log Cat
Log.e(TAG, "From: " + remoteMessage.getFrom());
Log.e(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
remoteMSG = remoteMessage.getNotification().getBody();
notifications.add(remoteMessage.getNotification().getBody());
sendNotification(remoteMessage.getNotification().getBody());
}
private void sendNotification(String messageBody) {
int i;
//onDismiss Intent
Intent intent = new Intent(this, NotificationActionReceiver.class);
PendingIntent broadcastIntent = PendingIntent.getBroadcast(this.getApplicationContext(), 0, intent, 0);
//OnClick Listener
startWFApplication().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, startWFApplication(),
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.icon_btn_volume)
.setContentTitle("Title")
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationCompat.InboxStyle inboxStyle =
new NotificationCompat.InboxStyle();
// Sets a title for the Inbox in expanded layout
inboxStyle.setBigContentTitle("Title - Notification");
inboxStyle.setSummaryText("You have " + notifications.size() + " Notifications.");
// Moves events into the expanded layout
//notifications.add(messageBody);
for (i = 0; i < notifications.size(); i++) {
inboxStyle.addLine(notifications.get(i));
}
// Moves the expanded layout object into the notification object.
notificationBuilder.setStyle(inboxStyle);
NotificationManager notificationManager =
(NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notificationBuilder.build());
notificationBuilder.setDeleteIntent(broadcastIntent);
}
public static Intent startWFApplication() {
Intent launchIntent = new Intent();
launchIntent.setComponent(new ComponentName("com.fcmdemo", "com.fcmdemo.MyFirebaseMessagingService"));
return launchIntent;
}
#Override
public void handleIntent(Intent intent) {
super.handleIntent(intent);
Log.e(TAG, "handleIntent" + remoteMSG);
}
}
Finally I found the solution. I've just put the condition before adding it.
for (i = 0; i < notifications.size(); i++) {
if (i <= 6) {
inboxStyle.addLine(notifications.get(i));
inboxStyle.setSummaryText("You have " + notifications.size() + " Notifications.");
} else {
inboxStyle.setSummaryText("You have " + notifications.size() + " Notifications.");
}
}
I'm trying to implement FCM on my apps. The tutorial source was from here.
The Push Notification was delivered successfully, but why isn't the message displayed in the header? (just like when receiving WhatsApp message). It just shows silently in the back list (after we scroll down the header). Also the push notification doesn't produce any sounds.
Here're my code :
AndroidManifest.xml :
<service android:name="com.myapps.TokenService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<service android:name="com.myapps.FCMMessageReceiverService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
FCMMessageReceiverService.java :
public class FCMMessageReceiverService extends FirebaseMessagingService {
#Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d("Notification Received",remoteMessage.getNotification().getBody());
sendNotification(remoteMessage.getNotification().getBody());
sendSnackbar(remoteMessage.getNotification().getBody());
}
private void sendNotification(String messageBody) {
Intent intent = new Intent(this, MyActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 , intent,
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(messageBody)
.setAutoCancel(false)
.setSound(defaultSoundUri);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1, notificationBuilder.build());
}
private void sendSnackbar(String messagebody)
{
}
}
TokenService.java :
public class TokenService extends FirebaseInstanceIdService {
#Override
public void onTokenRefresh() {
//super.onTokenRefresh();
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.w("notification", refreshedToken);
sendRegistrationToServer(refreshedToken);
}
private void sendRegistrationToServer(String token) {
}
}
<service
android:name=".MyFirebaseMessagingService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
Just add two attributes android:enabled and android:exported as shown above in AndroidManifest.xml
After a Push Notification is received, I want to open an Àctivity when the Notification is pressed.
Here are my Services:
public class GCMIntentService extends GcmListenerService {
#Override
public void onMessageReceived(String from, Bundle data) {
String title = data.getString("title");
String message = data.getString("message");
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(message)
.setStyle(new NotificationCompat.BigTextStyle().bigText(message))
.setTicker(message)
.setAutoCancel(true);
mBuilder.setDefaults(Notification.DEFAULT_LIGHTS);
mBuilder.setDefaults(Notification.DEFAULT_SOUND);
mBuilder.setDefaults(Notification.DEFAULT_VIBRATE);
Intent myIntent = new Intent(this, MyActivity.class);
PendingIntent intent2 = PendingIntent.getBroadcast(this, 1, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(intent2);
notificationManager.notify(1, mBuilder.build());
}
public class GCMIDListenerService extends InstanceIDListenerService {
#Override
public void onTokenRefresh() {
InstanceID instanceID = InstanceID.getInstance(this);
String token;
try {
token = instanceID.getToken(Resources.getSystem().getString(R.string.gcm_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
} catch (IOException e) {
e.printStackTrace();
}
//TODO:send token to the server
}
}
I just did everything following the Google documentation. I implemented that feature for another project sometime ago but it was a bit different, I used my own 'BroadcastReceiver' instead of the 'com.google.android.gms.gcm.GcmReceiver' provides by Google.
Here is my Manifest:
<application>
...
<!-- GCM Push Notifications Config -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="gcm" />
</intent-filter>
</receiver>
<service
android:name=".push.GCMIntentService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".push.GCMIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
</application>
Any ideas? Am I missing something?
Here some documentation I have follow:
Google official documentation
CGM tutorial By Dustin Rothwell
And of course I have researched a lot here at stackoverflow.
Thanks!
You have done one minor mistake. You are writing this code for opening activity.
PendingIntent intent2 = PendingIntent.getBroadcast(this, 1, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(intent2);
As you want to open activity you need to create pending intent using getActivity method instead of getBroadcast method.
Hope this will help.
I need help implementing a ParsePushBroadcastReceiver,
in order to use it to parse a JSON Object, to choose an Activity to start.
I've tried with:
<receiver
android:name="com......BroadcastReceiver"
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>
Or
<receiver android:name="com....BroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
But no success...
My application class
public class AppApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
System.out.println("vrum");
Parse.initialize(this, "...", "..");
PushService.setDefaultPushCallback(this, HomeActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
When I click the notification I get to the HomeActivity...same thing if I remove that line
PushService.setDefaultPushCallback(this, HomeActivity.class);
public class ParseCustomBroadcastReceiver extends ParsePushBroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
try {
// Sample code
JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
final String notificationTitle = json.getString("title").toString();
final String notificationContent = json.getString("alert").toString();
final String uri = json.getString("uri");
//Create a taskstack builder - this is just sample snippet to give an idea
Intent resultIntent = null;
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
resultIntent = new Intent(context, NotificationOpenActivity.class);
stackBuilder.addParentStack(NotificationOpenActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
// Customize your notification
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_notification_icon)
.setContentTitle(notificationTitle)
.setContentText(notificationContent)
.setGroup(GROUP_SHORTR_NOTIFS)
.setContentIntent(resultPendingIntent)
.setAutoCancel(true)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setDefaults(Notification.DEFAULT_VIBRATE)
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(notificationContent));
int mNotificationId = 001;
NotificationManager mNotifyMgr =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotifyMgr.notify(mNotificationId, builder.build());
} catch (JSONException e) {
Log.d(TAG, e.getMessage());
}
}
}
Add the following in the manifest.
<receiver
android:name=".receivers.ParseCustomBroadcastReceiver"
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>
Basically, for the manifest edits picking up from your question, simply edit the android:name property.
Hope this helps!