Android - C2DM Registration Failed to Receive

I am trying to register my device using C2DM and am having serious problems. I followed several tutorials, all of which are very similar. I believe the problem is with the intention of registering, which it sends to the C2DM server. Anyone have any suggestions. Below is the corresponding code:

Manifest: Permissions (outside my application tag):

<!-- Used for C2DM -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.companyname.parade.permission.C2D_MESSAGE" />

This is the registration of intent (inside my application tag):

<receiver
    android:name=".C2DMReceiver"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <!-- Receive the actual message -->
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />

        <category android:name="com.companyname.parade" />
    </intent-filter>
    <!-- Receive the registration id -->
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
        <category android:name="com.companyname.parade" />
    </intent-filter>
</receiver>

- , , C2DM ( , C2DM, , , ). C2DMessaging:

public static void register(Context context) {
    Intent registrationIntent = new Intent(REQUEST_REGISTRATION_INTENT);
    registrationIntent.putExtra(EXTRA_APPLICATION_PENDING_INTENT,
            PendingIntent.getBroadcast(context, 0, new Intent(), 0));
    registrationIntent.putExtra(EXTRA_SENDER, SENDER_ID);
    ComponentName name = context.startService(registrationIntent);
    if(name == null){
        // FAIL!
        Log.d(TAG, "FAIL");
    }else{
        // SUCCESS
        Log.d(TAG, "Success");
    }
}

ComponentName :

com.google.android.gsf/com.google.android.gsf.gtalkservice.PushMessagingRegistrar

logcat. ( C2DMReceiver) :

@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (C2DMessaging.INTENT_REGISTRATION_CALLBACK.equals(action)) {
        // Registration Intent
        Log.w(TAG, "Registration Receiver called");
        handleRegistration(context, intent);
    } else if (action.equals(C2DMessaging.INTENT_RECEIVED_MESSAGE_CALLBACK)) {
        Log.w(TAG, "Message Receiver called");
        handleMessage(context, intent);
    } else if (action.equals(C2DMessaging.INTENT_C2DM_RETRY)) {
        C2DMessaging.register(context);
    }
}

.

. . - , . :

<permission android:name="com.companyname.parade.permission.C2D_MESSAGE" android:protectionLevel="signature" />

MisterSquonk .

+3
2

Google C2DM <permission> <uses-permission> C2D_MESSAGE.

- ...

<permission android:name="com.companyname.parade.permission.C2D_MESSAGE" android:protectionLevel="signature" />
+2

, : http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html

, . - com.google.android.c2dm.intent.REGISTRATION(. )

, - , . - , , .

, C2DM .

, Android C2DM . , , , .

0

All Articles