Android GCM Unable to start service Intent - android

Hello I want to make a simple notification application.
I am using this (http://www.youtube.com/watch?v=rmzv716SYkQ) tutorial.
here is my codes.
manifest file
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.myapp.ntfapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.turk.bakistik.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
manifest file in application block
<receiver
android:name=".MyNotificationService"
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.ntfapp" />
</intent-filter>
</receiver>
MyNotificationService Class
public class MyNotificationService extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
try {
String action = intent.getAction();
if (action.equals("com.google.android.c2dm.intent.REGISTRATION")) {
String registrationId = intent.getStringExtra("registration_id");
Log.i("ui", registrationId);
String error = intent.getStringExtra("error");
String unregistered = intent.getStringExtra("unregistered");
}
else if (action.equals("com.google.android.c2dm.intent.RECEIVE")) {
String data1 = intent.getStringExtra("data1");
String data2 = intent.getStringExtra("data2");
}
} finally { }
}
}
Activate and Deactivate buttons in main activity
button2=(Button)findViewById(R.id.button2);
button3=(Button)findViewById(R.id.button3);
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(v.getContext(), 0, new Intent(), 0));
registrationIntent.putExtra("sender", "123456789101112");
startService(registrationIntent);
}
});
button3.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
unregIntent.putExtra("app", PendingIntent.getBroadcast(v.getContext(), 0, new Intent(), 0));
startService(unregIntent);
}
});
When I click activate button
W/ActivityManager(70): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION (has extras) }: not found
How can I fix this problem?

I see an inconsistency in your manifest :
<permission
android:name="com.myapp.ntfapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.turk.bakistik.permission.C2D_MESSAGE" />
You should use your app's package name in both (either com.myapp.ntfapp
or com.turk.bakistik).
In addition, you are using an old and obsolete way to register to GCM. You should use the GoogleCloudMessaging.register method which is part of the Google Play Services library.

Related

My app does not receive Parse push notifications

I have setup my app for Parse notifications and strictly followed the instructions, but somehow I don't receive any notification. What is the problem here?
Update: I just tried sending a test push notification on the Parse.com website. That should work without subscribing to a channel (see comment)
My AndroidManifest.xml (only the relevant parts):
<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" />
<permission android:protectionLevel="signature"
android:name="co.bla.bla.permission.C2D_MESSAGE" />
<uses-permission android:name="co.bla.bla.permission.C2D_MESSAGE" />
<!-- Push notification setup -->
<service android:name="com.parse.PushService" />
<receiver android:name="co.bla.bla.ParsePushReceiver"
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="co.bla.bla" />
</intent-filter>
</receiver>
</application>
And I have extended ParsePushBroadcastReceiver:
public class ParsePushReceiver extends com.parse.ParsePushBroadcastReceiver{
#Override
protected void onPushReceive(Context context, Intent intent ) {
ParseAnalytics.trackAppOpenedInBackground(intent);
String s = intent.getStringExtra("alert");
Log.d("Push received", s);
// do your stuff here
if(SugarSnapApplication.INACTIVE)
super.onPushReceive(context, intent);
}
#Override
protected void onPushOpen(Context context, Intent intent) {
// TODO Auto-generated method stub
Intent i = new Intent(context, SugarActivity.class);
i.putExtras(intent.getExtras());
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
#Override
protected Notification getNotification(Context context, Intent intent) {
// TODO Auto-generated method stub
return super.getNotification(context, intent);
}
#Override
protected void onPushDismiss(Context context, Intent intent) {
// TODO Auto-generated method stub
super.onPushDismiss(context, intent);
}
}
I finally found out what the problem was. I have renamed the whole package name of my application a couple of days ago and apparently the change was not made everywhere and the applicationId in my build.gradle file was still the old one. So naturally the package name in my AndroidManifest.xml was not the same as the one saved in my Installation class.

Android 4.x devices receive GCM messages, but Android 2.3 devices Don't

My android app never receives GCM messages on 2.3 devices, but it does on 4.x devices. I can register all devices (2.3 and 4.x) successfully. I thought it might have something to do with this issue, but it seems like I have my android manifest configured properly. Would anyone be able to eyeball my IntentService and BroadcastReceiver and see if they notice any problems? Any help would be greatly appreciated. Note that onHandeIntent() is never called for Android 2.3 when sending notifications while I have the debugger attached. I checked 4.x devices, and they do trigger the debugger in onHandleIntent().
Thanks!
Android Manfest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="9" 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.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" />
<uses-permission android:name="my.package.matchtracker.permission.C2D_MESSAGE" />
<permission android:name="my.package.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<receiver
android:name=".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" />
</intent-filter>
</receiver>
<service android:name=".NotificationIntentService" android:enabled="true" />
<activity android:name="com.gigya.socialize.android.GSWebViewActivity" />
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Broadcast Receiver:
package my.package;
import android.app.*;
import android.content.*;
public class GcmBroadcastReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
NotificationIntentService.runIntentInService(context, intent);
setResultCode(Activity.RESULT_OK);
}
}
Notification Intent Service
public class NotificationIntentService extends IntentService {
private String TAG = "NotificationIntentService";
public NotificationIntentService() {
super(AppConstants.GCM_SENDER_ID);
}
public NotificationIntentService(String name) {
super(name);
// TODO Auto-generated constructor stub
}
private static PowerManager.WakeLock sWakeLock;
private static final Object LOCK = NotificationIntentService.class;
static void runIntentInService(Context context, Intent intent) {
synchronized(LOCK) {
if (sWakeLock == null) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
sWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "my_wakelock");
}
}
sWakeLock.acquire();
intent.setClassName(context, NotificationIntentService.class.getName());
context.startService(intent);
}
public final void onHandleIntent(Intent intent) {
try {
String action = intent.getAction();
if (action.equals("com.google.android.c2dm.intent.REGISTRATION")) {
//don't care.
} else if (action.equals("com.google.android.c2dm.intent.RECEIVE")) {
handleMessage(intent);
}
} finally {
synchronized(LOCK) {
sWakeLock.release();
}
}
}
private void handleMessage(Intent intent) {
Bundle b = intent.getExtras();
String text = b.getString("text"),
title = b.getString("title"),
largeImageUrl = b.getString("largeImageUrl");
Log.i(TAG, "Message is " + text);
NotificationManager nm = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
Bitmap bit=null;
if (largeImageUrl != null && !largeImageUrl.isEmpty()) {
try{bit = BitmapFactory.decodeStream((InputStream)new URL(largeImageUrl).getContent());
} catch (Exception e){}
}
NotificationCompat.Builder nc = new NotificationCompat.Builder(this)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(R.drawable.ic_launcher)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setAutoCancel(true) //notification disappears when clicked
.setContentIntent(PendingIntent.getActivity(this, 0,
new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT));
//bit = Bitmap.createScaledBitmap(bit, android.R.dimen.notification_large_icon_width, android.R.dimen.notification_large_icon_height, true);
if (bit != null) nc.setLargeIcon(bit);
nm.notify(0, nc.build());
}
}
The first potential problem I can see is this :
The package name in the permission element is not the same as the one in the uses-permission element. In my app (which targets Android 2.2) they are identical.
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="my.package.matchtracker.permission.C2D_MESSAGE" />
<permission android:name="my.package.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
If you are using product flavor with different applicationId, see my answer to the question GCM messages are not received on android 2.3.6 v but working fine on android 4.X v
GCM need google play services installed on device but in version 2.3 it's not installed by default.

SipDemo's onReceive() SipAudioCall NullPointerException give

I am Creating incoming call Receive activity by SipDemo . My activity has two button "accept call" and "reject call". When i got incoming call then my own activity is open such as
----> incoming call class ----> onReceive()----> go to my call pick activity.
here is this above two button such as accept and reject call. but when i hit on "accept call" . A Nullpointer Exception generate. it is on SipAudiocall incoming;
this is incoming class:-
static SipAudioCall incomingCall = null;
#Override
public void onReceive(final Context context, Intent intent) {
Intent startActivity = new Intent();
startActivity.setClass(context, Mycall.class);
startActivity.setAction(IncomingCallReceiver.class.getName());
startActivity.setFlags(
Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(startActivity);
}
public static void acceptCall() {
incomingCall.sendDtmf(9);
try {
incomingCall.sendDtmf(9);
incomingCall.answerCall(200);
//wtActivity.gototimer("i");
} catch (SipException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// wtActivity.gototimer("i");
}
public void rejectCaLL() {
try {
incomingCall.endCall();
} catch (SipException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
This is my call pick activity class:-
public class Mycall extends Activity {
Button acct;
IncomingCallReceiver incomingCallReceiver;
#Override
public void onCreate(Bundle savedInstanceState) {
// Note that none of the preferences are actually defined here.
// They're all in the XML file res/xml/preferences.xml.
super.onCreate(savedInstanceState);
setContentView(R.layout.my);
acct = (Button) findViewById(R.id.button1);
acct.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
IncomingCallReceiver.acceptCall();
}
});
}
}
This is AndroidManifest.xml :-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.sip">
<application android:icon="#drawable/icon" android:label="SipDemo">
<service android:name=".MService">
</service>
<activity android:name=".WalkieTalkieActivity"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".SipSettings" android:label="set_preferences"/>
<receiver android:name=".IncomingCallReceiver" android:enabled="true" android:label="Call Receiver">
<intent-filter>
<action android:name="android.SipDemo.INCOMING_CALL" />
</intent-filter>
</receiver>
<activity android:name=".Mycall"
>
</activity>
<activity android:name=".Myclass"/>
</application>
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-feature android:name="android.hardware.sip.voip" android:required="true" />
<uses-feature android:name="android.hardware.wifi" android:required="true" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />
Please Expert Help me. I has involved this problem since 1 month.
I am wait for your response.
Thank you
Becouse your
IncomingCallReceiver incomingCallReceiver;
is null at time of calling it...
If you create a static class you must take care to initiate it maybe in creator-method.
create an abstract class:
public abstract class IncomingCallReceiver
and change your method to public static final

Android GCM Registration Device

I am developing an application where i have to register my device with GCM but it is not registering my device. i have granted all permissions to the applications in the menifest
my log is here
Method to register onGCM is
public void register()
{
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
if (GCMRegistrar.isRegistered(this))
{
Log.d("info", GCMRegistrar.getRegistrationId(this));
}
final String regId = GCMRegistrar.getRegistrationId(this);
System.out.println("registration ID is " + regId);
if (regId.equals(""))
{
System.out.println("registration ID is " + regId);
GCMRegistrar.register(this, CommonUtilities.SENDER_ID);
Log.d("info", GCMRegistrar.getRegistrationId(this));
System.out.println("Get Reg ID: " + GCMRegistrar.getRegistrationId(this));
}
else
{
Log.d("info", "already registered as" + regId);
}
}
and my GCM service is
public class GCMService extends GCMBaseIntentService
{
public GCMService()
{
super(CommonUtilities.SENDER_ID);
}
public void generateNotification(Context context, String message)
{
long when = System.currentTimeMillis();
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.ic_launcher, message, when);
String title = context.getString(R.string.app_name);
Intent notificationIntent = new Intent(context, OffersActivity.class);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
notification.setLatestEventInfo(context, title, message, intent);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS;
notificationManager.notify(0, notification);
}
#Override
protected void onError(Context arg0, String arg1)
{
}
#Override
protected void onMessage(Context arg0, Intent arg1)
{
Log.d("GCM", "RECIEVED A MESSAGE");
generateNotification(arg0, "New Offers Are Available");
}
#Override
protected void onRegistered(Context arg0, String arg1)
{
}
#Override
protected void onUnregistered(Context arg0, String arg1)
{
}
}
and my menifest is
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Map Location permissions -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Notification permissions -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.READ_OWNER_DATA" />
<permission
android:name="myPackage.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<!-- Storage permissions -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Internet permissions -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Call Phone permissions -->
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="cmyPackage.SplashScreen"
android:label="AppName"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="myPackage.CatagoriesActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name="myPackage.OffersActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name="myPackage.SettingsActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name="myPackage.OfferDetailsAtivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name="myPackage.DealInfoActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:theme="#android:style/Theme.NoTitleBar" >
</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="myPackage" />
</intent-filter>
</receiver>
<service android:name=".GCMService" />
<uses-library android:name="com.google.android.maps" />
</application>
I/System.out(17369): Registering
D/GCMRegistrar(17369): resetting backoff for packageName
V/GCMRegistrar(17369): Registering app packageName of sendersID xxxxxxxxxxxxxx
registration id Still Empty
(17369): Not yet registered
i have multiple packages in my application
public final class CommonUtilities
{
public static final String SENDER_ID = "xxxxxxxxxxxxx";
static final String TAG = "AndroidHive GCM";
public static final String DISPLAY_MESSAGE_ACTION = "myPackage.pushNotifications.DISPLAY_MESSAGE";
static final String EXTRA_MESSAGE = "message";
static void displayMessage(Context context, String message)
{
Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
intent.putExtra(EXTRA_MESSAGE, message);
context.sendBroadcast(intent);
}
}
You should include your log output so that we know what happens when you run your app. You should also take a look at the GCM demo and use that as your base because you seem to be missing some important code: http://code.google.com/p/gcm/source/browse/samples/gcm-demo-client/src/com/google/android/gcm/demo/app/DemoActivity.java
If you get your registration ID from GCM then you are registered with GCM (are you getting a registration ID?) and the next step is to register with your server. This should happen in the else of the following If block:
if (regId.equals(""))
And in onRegistered in your GCM service as well. That is the callback that will be triggered when your app is successfully registered with GCM. Getting the registration ID right after attempting to register will not output anything since the registration with GCM is asynchronous.
If it is not already resolved .. I guess This could be the cause of problem... add this
<uses-permission android:name="my_app_package.permission.C2D_MESSAGE" />
to your android manifest xml.
Hope it helps.
You have to enter your unique_ID(i.e. of 12 character) CommonUtilities.java
/**
* Google API project id registered to use GCM.
*/
static final String SENDER_ID = 123456789012; <----

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