[Backendless 4] Device registration not working

Hello,

with Backendless 4.0 I can’t get device registration to work. For testing device registration I’ve used the downloaded sample project and did all steps from the documentation:

changed manifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="my.package.name.permission.C2D_MESSAGE"/>
<permission android:name="my.package.name.permission.C2D_MESSAGE"
    android:protectionLevel="signature"/>
<receiver android:name="com.backendless.push.BackendlessBroadcastReceiver"
    android:permission="com.google.android.c2dm.permission.SEND">
    &lt;intent-filter&gt;
        <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
        &lt;category android:name=&quot;my.package.name&quot;/&gt;
    &lt;/intent-filter&gt;
&lt;/receiver&gt;
&lt;service android:name=&quot;com.backendless.push.BackendlessPushService&quot; /&gt;

And inside my main activity

Backendless.Messaging.registerDevice("GCM-Sender-ID", "default", new AsyncCallback&lt;Void&gt;() {
    @Override
    public void handleResponse(Void response) {
        Log.d("TESTAPP", "WORKS");
    }

    @Override
    public void handleFault(BackendlessFault fault) {
        Log.d("TESTAPP", "ERROR: "+fault.getMessage()+" "+fault.getCode());
    }
});

I get an error on application start with the following message:

No receivers for action com.google.android.c2dm.intent.REGISTRATION IllegalArgumentException

Did I miss something? According to some entries on google c2dm.intent.REGISTRATION should be deprecated…

Thank you,
Michael

Hi Michael,

Could you please attach or paste your manifest file in its entirety?

Regards,
Mark

Hello Mark,

I’ve attached the manifest file contents as text file. I’ve just change my real package name to “my.package.name”.

Regards,
Michael

manifest.txt (1.48kB)

Hi Mark,

could you already look into my manifest file and find anything out?

Thank’s
Michael

Hallo,

sorry for asking again, but this is really important for me to proceed with development.

It seems there is a problem with device registration because I can’t get it to work.

Do you need still more information from me? Can you please give me at least a quick status update? Otherwise I will have to look for another backend solution…

Thank you and kind regards,
Michael

Hi Michael,

I looked into it and found that the documentation is missing an instruction for the following line:

 <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>

Thus the receiver registration in the manifest must look as shown below:

<receiver android:name="com.backendless.push.BackendlessBroadcastReceiver"
    android:permission="com.google.android.c2dm.permission.SEND">
    &lt;intent-filter&gt;
        <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
        <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
        &lt;category android:name=&quot;foo.com.pushtest&quot;/&gt;
    &lt;/intent-filter&gt;
&lt;/receiver&gt;

I tried it with that configuration and it works.

Regards,
Mark