Error:- getting error while getting registration id for c2dm - android

I have Written the application for getting registration id for c2dm. but i am getting Exception as unable to start activity component info at line startService(intent);
My main class is
public class IdTestActivity extends Activity {
static TextView mytext = null;
Context context = null;
Intent intent = null;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER");
intent.putExtra("app",PendingIntent.getBroadcast(this, 0, new Intent(), 0));
intent.putExtra("sender", "dvimayandroid#gmail.com");
startService(intent);
}
}
My Receiver class is
public class c2dmReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.w("C2DM", "Registration Receiver called");
if ("com.google.android.c2dm.intent.REGISTRATION".equals(action)) {
Log.w("C2DM", "Received registration ID");
final String registrationId = intent
.getStringExtra("sender");
String error = intent.getStringExtra("error");
Log.d("C2DM", "dmControl: registrationId = " + registrationId
+ ", error = " + error);
// TODO Send this to my application server
}
}
}
and my manifest file is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.IdTest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application>
<permission
android:name="com.IdTest.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.IdTest.permission.C2D_MESSAGE" />
<activity
android:name=".IdTestActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".c2dmReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter >
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="com.IdTest" />
</intent-filter>
</receiver>
</application>
</manifest>

It looks like you need to add a permission to your manifest. Check what's needed here, and make sure your app includes everything:
http://code.google.com/android/c2dm/#manifest

you should add the permission to reveive messages from C2DM Servers like this in your manifest :
<!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

i think you should add the registration intent filter to your service by this you could get the registration id
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="your pacakge" />
</intent-filter>
also you to get the coming registration id you use
intent.getStringExtra("registration_id");
hope that could help you

Related

Failed to resolve target intent service. Push notifications Android

I am getting following error when trying to configure Push Notification:
Failed to resolve target intent service, skipping classname enforcement
Error while delivering the message: ServiceIntent not found.
Manifest:
<manifest package="com.packageName"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <!-- support previous 4.4 KitKat devices-->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.packageName.permission.C2D_MESSAGE" />
<application
android:name="AppName"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.Black.NoTitleBar">
<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="com.packageName" />
</intent-filter>
<intent-filter> <!-- support previous 4.4 KitKat devices-->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.packageName" />
</intent-filter>
</receiver>
<service
android:name="com.packageName.activities.RegistrationIntentService"
android:exported="false" >
</service>
<service
android:name="com.packageName.activities.GcmIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name="com.packageName.activities.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
</application>
MyGcmListenerService:
public class MyGcmListenerService extends GcmListenerService {
#Override
public void onMessageReceived(String from, Bundle data) {
String message = data.getString("message");
Log.d("From", "From: " + from);
Log.d("Msg", "Message: " + message);
}
}
RegistrationIntentService
public class RegistrationIntentService extends IntentService {
private static String SENDER_ID = "MySenderID";
public RegistrationIntentService(){
super(SENDER_ID);
}
#Override
public void onHandleIntent(Intent intent){
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
try {
InstanceID instanceID = InstanceID.getInstance(this);
String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
Log.i("TOKEN", "GCM Registration Token: " + token);
} catch (Exception e) {
Log.d("Fail token", "Failed to complete token refresh", e);
}
}
}
GcmIDListenerService
public class GcmIDListenerService extends InstanceIDListenerService {
#Override
public void onTokenRefresh() {
Intent intent = new Intent(this, RegistrationIntentService.class);
startService(intent);
}
}
I have placed google-services.json in projectName/app
I send push notification from web http://techzog.com/development/gcm-notification-test-tool-android/ and the response is success:1 but it not received in Android device.

Attempt to invoke virtual method 'void com.pushbots.push.utils.PBPrefs.setCustomHandler(java.lang.String)' on a null object r

I am use push bots API for push notification i got exception null pointer when i try to implement Custom handler for notifications.
Here is documentation where i learn
https://pushbots.com/developer/docs/android-sdk-integration
My Android manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.assorttech.assorttech" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.assorttech.assorttech.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.assorttech.assorttech.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive dataf message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="com.assorttech.assorttech.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.thefinestartist.finestwebview.FinestWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="sensor"
android:theme="#style/FinestWebViewTheme.Light"
>
</activity>
<receiver
android:name="com.pushbots.google.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.assorttech.assorttech" />
</intent-filter>
</receiver>
<receiver android:name="com.pushbots.push.DefaultPushHandler" />
<!--<receiver android:name="com.assorttech.assorttech.customHandler" />-->
<service android:name="com.pushbots.push.GCMIntentService" />
</application>
</manifest>
public class customHandler extends BroadcastReceiver
{
private static final String TAG = "customHandler";
public void onReceive(Context context, Intent intent)
{
String action = intent.getAction();
Log.d(TAG, "action=" + action);
// Handle Push Message when opened
if (action.equals(PBConstants.EVENT_MSG_OPEN)) {
//Check for Pushbots Instance
Pushbots pushInstance = Pushbots.sharedInstance();
if(!pushInstance.isInitialized()){
// Log.d("Initializing Pushbots.");
Pushbots.sharedInstance().init(context.getApplicationContext());
}
//Clear Notification array
if(PBNotificationIntent.notificationsArray != null){
PBNotificationIntent.notificationsArray = null;
}
HashMap<?, ?> PushdataOpen = (HashMap<?, ?>) intent.getExtras().get(PBConstants.EVENT_MSG_OPEN);
Log.w(TAG, "User clicked notification with Message: " + PushdataOpen.get("message"));
//Report Opened Push Notification to Pushbots
if(Pushbots.sharedInstance().isAnalyticsEnabled()){
Pushbots.sharedInstance().reportPushOpened( (String) PushdataOpen.get("PUSHANALYTICS"));
}
//Start lanuch Activity
String packageName = context.getPackageName();
Intent resultIntent = new Intent(context.getPackageManager().getLaunchIntentForPackage(packageName));
resultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_CLEAR_TASK);
resultIntent.putExtras(intent.getBundleExtra("pushData"));
Pushbots.sharedInstance().startActivity(resultIntent);
// Handle Push Message when received
}else if(action.equals(PBConstants.EVENT_MSG_RECEIVE)){
HashMap<?, ?> PushdataOpen = (HashMap<?, ?>) intent.getExtras().get(PBConstants.EVENT_MSG_RECEIVE);
Log.w(TAG, "User Received notification with Message: " + PushdataOpen.get("message"));
}
}
}
Main Activity:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Pushbots.sharedInstance().setCustomHandler(customHandler.class);
}
You need to add
Pushbots.sharedInstance().init(this);
in your activity's onCreate() method.

Parse SDK implement custom BroadcastReceiver for push notifications in android

I am trying to get started with Parse push notification on Android, but I could not find any way to implement my own BroadcastReceiver which would perform action in response to a push notification.
In their "getting started", they give a program sample where the receiver and the intent service is contained in the jar file (and not implemented in the code, so that I could try and play with it). A similar question has been asked here, but it's two years old and the answer has 11 downvotes.
There are a few other blog posts, e.g. as in here, but none of them work properly (the one in that link was two years old).
So please kindly suggest a step by step way to implement the same.
EDIT:
I tried the code as suggested by droidx. But it does not work. I am sending my AndroidManifest.xml (rest of the code is exactly as he suggested):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rahulserver.parsenotificationdemo" >
<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:protectionLevel="signature"
android:name="com.rahulserver.parsenotificationdemo.permission.C2D_MESSAGE" />
<uses-permission android:name="com.rahulserver.parsenotificationdemo.permission.C2D_MESSAGE" />
<application
android:name=".ParseNotification"
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" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</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=".MyCustomParsePushReceiver"
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.rahulserver.parsenotificationdemo" />
</intent-filter>
</receiver>
</application>
</manifest>
Here's an example!
public class ParseCustomBroadcastReceiver extends ParsePushBroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
try {
JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
Log.d(TAG, json.getString("alert").toString());
final String notificationTitle = json.getString("title").toString();
final String notificationContent = json.getString("alert").toString();
final String uri = json.getString("uri");
Intent resultIntent = null;
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
resultIntent = new Intent(context, HomeScreen.class);
stackBuilder.addParentStack(HomeScreen.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
//Customize your notification - sample code
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_notification_icon)
.setContentTitle(notificationTitle)
.setContentText(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());
}
}
}
Following this guide, replace android name for the receiver to the path of your custom broadcastreceiver
<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>
In your application class, make sure to have subscribed to Parse Push like this
Parse.initialize(this, ParseUtils.PARSE_APPLICATION_ID_DEV, ParseUtils.PARSE_CLIENT_KEY_DEV);
ParseObject.registerSubclass(Article.class);
ParsePush.subscribeInBackground("", new SaveCallback() {
#Override
public void done(ParseException e) {
if (e == null) {
Log.d(TAG, "successfully subscribed to the broadcast channel.");
} else {
Log.e(TAG, "failed to subscribe for push", e);
}
}
});
Update:
The above broadcast receiver expects to send a json object notification from parse dashboard usually consists of three name value pairs:
{ "alert": "Alert message", "title": "Title", "uri": "bla bla" }
When you use only plain string for eg: hello world! in parse push dashboard, internally it goes as only alert tag. something like this : {"alert" : "hello world!, "title" = null/"", "uri" = null/""}
The broadcast receiver code above doesn't have this null checks, so it's caught in the catch with exception No title/uri.
So you can add some null checks based on what you are expecting from the push notification.
Something like this:
JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
Log.d(TAG, json.getString("alert").toString());
if (json.has("title")) {
notificationTitle = json.getString("title").toString();
}
if (json.has("alert")) {
notificationAlert = json.getString("alert").toString();
}
if(json.has("uri")) {
notificationURI = json.getString("uri");
}
Then set appropriate contentTitle and contentText in notification
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(notificationAlert)
.setContentText(notificationAlert);
Hope this helps!

GCM: register the device [GCMRegistrar.register(this, SENDER_ID)]

I have a important delivery, i hope you can help me.
I have to use GCM.
I am using the file in the official guide in http://developer.android.com/guide/google/gcm/demo.html
I did "Setting Up the Server Using App Engine for Java" and it work.
My problem is the android application .Exactly I don't recive the id from GCM and so anytime my application try the registration.
Thanks a lot....
public class DemoActivity extends Activity {
TextView mDisplay;
AsyncTask<Void, Void, Void> mRegisterTask;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
checkNotNull(SERVER_URL, "SERVER_URL");
checkNotNull(SENDER_ID, "SENDER_ID");
// Make sure the device has the proper dependencies.
GCMRegistrar.checkDevice(this);
// Make sure the manifest was properly set - comment out this line
// while developing the app, then uncomment it when it's ready.
GCMRegistrar.checkManifest(this);
setContentView(R.layout.main);
mDisplay = (TextView) findViewById(R.id.display);
registerReceiver(mHandleMessageReceiver,
new IntentFilter(DISPLAY_MESSAGE_ACTION));
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
// Automatically registers application on startup.
GCMRegistrar.register(this, SENDER_ID);
} else {
....
}
CommonUtilities
public final class CommonUtilities
{
static final String SERVER_URL = "http://127.0.0.1:8888/gcmdemo4/home";
static final String SENDER_ID = "843761346XXX";
...
}
GCMIntentService
public class GCMIntentService extends GCMBaseIntentService {
#SuppressWarnings("hiding")
private static final String TAG = "GCMIntentService";
public GCMIntentService() {
super(SENDER_ID);
}
#Override
public void onRegistered(Context context, String registrationId) {
Log.i(TAG, "Device registered: regId = " + registrationId);
displayMessage(context, getString(R.string.gcm_registered));
ServerUtilities.register(context, registrationId);
}
.....
MY manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.registrazionegcm"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<permission
android:name="com.example.registrazionegcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.registrazionegcm.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="DemoActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.google.android.gcm.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.registrazionegcm" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
could you supply your code of "registerReceiver".
I had the same problem, when my SENDER_ID was wrong.
Try to check it again, and check your package too: com.example.registrazionegcm.GCMIntentService
Put some breakpoint in onError and onRegistered
For me, this code works:
#Override
public void run() {
GCMRegistrar.checkDevice(mContext);
GCMRegistrar.checkManifest(mContext);
String deviceToken = GCMRegistrar.getRegistrationId(mContext);
if (deviceToken.equals("")) {
GCMRegistrar.register(mContext, "XXXXXXXXXXXXXXX");
deviceToken = GCMRegistrar.getRegistrationId(mContext);
if(!deviceToken.equals("")){
GCMRegistrar.setRegisteredOnServer(mContext, true);
// register deviceToken on CommNotes srv
RequestMaker req = new RequestMaker(Constant.REQ_REGISTER_GCM, mContext);
//if unsuccessful, try again 5 times
for(int i = 0; i<5; i++){
Log.d("ComNotes", "registration id"+deviceToken);
if(req.doRequest(deviceToken) == ReturnCode.CODE_OK){
break;
}
}
}
//TODO manage unsuccess: display error : "No PUSH available"
} else {
Log.v("CommunityNotes", "Already registered "+deviceToken);
}
}

How to get the registration id for c2dm

I am trying to get the registration ID for C2DM in android for mobile app. I have tried some code but its not working properly not providing any registration id can someone help me in this case so i can get the registration id successfully for c2dm.
My main activity is
public class IdTest1Activity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER");
intent.putExtra("app",PendingIntent.getBroadcast(this, 0, new Intent(), 0));
intent.putExtra("sender", "youruser#gmail.com");
startService(intent);
}
}
my receiver class is
public class C2dmReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.w("C2DM", "Registration Receiver called");
if ("com.google.android.c2dm.intent.REGISTRATION".equals(action)) {
Log.w("C2DM", "Received registration ID");
final String registrationId = intent
.getStringExtra("registration_id");
String error = intent.getStringExtra("error");
Log.d("C2DM", "dmControl: registrationId = " + registrationId
+ ", error = " + error);
// TODO Send this to my application server
}
}
}
My Manifest file is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.IdTest1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<permission
android:name="com.IdTest1.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.IdTest1.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".IdTest1Activity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".C2dmReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="com.IdTest1" />
</intent-filter>
</receiver>
</application>
</manifest>
Change com.google.android.c2dm.intent.REGISTRATION in your receiver - .C2dmReceiver to com.google.android.c2dm.intent.RECEIVE, and it should be ok then.

Categories

Resources