broadcast intent callback: result=CANCELLED forIntent
Asked Answered
F

2

6

I have a mobile app, that registers to a c2dm server.

I have a server that sends a message to my app, to push a notification. The server receives ok result code from google c2dm.

In LogCat i see that my app receives the message but immediately produces the error i have in my post. And also the notification that i created is ignored.

08-10 16:28:09.157: W/GTalkService(13962): [DataMsgMgr] broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.example.c2dmclient (has extras) }

i don't get it. My manifest file is:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.c2dmclient"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <permission android:name="com.example.c2dmclient.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="com.example.c2dmclient.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <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"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


        <receiver
            android:name=".C2DMRegistrationReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter >
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" >
                </action>

                <category android:name="com.example.c2dmclient" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".C2DMMessageReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter >
                <action android:name="com.google.android.c2dm.intent.RECEIVE" >
                </action>

                <category android:name="com.example.c2dmclient" />
            </intent-filter>
        </receiver>

        <activity android:name="com.example.c2dmclient.RegistrationResultActivity" >
        </activity>
        <activity android:name="com.example.c2dmclient.MessageReceivedActivity" >
        </activity>

    </application>

</manifest>

If someone could help me please. i'm out of ideas

Figueroa answered 10/8, 2012 at 13:41 Comment(2)
Please explain the problem, instead of just dumping some code and saying "I don't get it". What are you trying to do? What exactly is the problem?Brewery
i dind't pay'd attention, i'm sorry.Figueroa
F
0

Finally i have found where was the problem. When i was creating the notification, in the place of logo id, i have put 0. Now all it's working.

Figueroa answered 13/8, 2012 at 12:4 Comment(2)
what is logo id.?Beverleebeverley
yea.. what is log id?Yingling
A
6

According to this forum post the situation arises in Android 3.1+ when the receiving app is in stopped state on the device (for example by using force stop from the settings). It will only start to receive messages again when it is manually started.

See also this post

Arie answered 18/2, 2013 at 9:50 Comment(0)
F
0

Finally i have found where was the problem. When i was creating the notification, in the place of logo id, i have put 0. Now all it's working.

Figueroa answered 13/8, 2012 at 12:4 Comment(2)
what is logo id.?Beverleebeverley
yea.. what is log id?Yingling

© 2022 - 2024 — McMap. All rights reserved.