Push notifications on emulator working, but not on real device
Asked Answered
D

2

2

I got a working example of a third party server to send push notifications to the device which is perfectly working in the Android emulators I use. As soon as I try to use it on my real device (Samsung Galaxy S) I don't receive my notifications anymore, even tough I reregister the device at the google server (as I use the same gmail account). I basically have no clue where to start looking as Logcat is not giving me any interesting information about it. The code is working in the emulator device, so my guess would be to start looking at the permission rules. Any ideas?

I don't know if this matters, but I am using Ubuntu 10.10 to develop/debug.

Donets answered 14/4, 2011 at 8:26 Comment(2)
you can debug on actual device developer.android.com/guide/developing/device.html and look at the logsMasticate
@Yekmer yes, I did that, there is no sign exception indicating a problem in there..Donets
M
4

Is your ROLE Account gmail ID same as the gmail ID configured on the phone ? I did have problems with this. If so, can you try using some other gmail ID on the phone ? For more see this.

Manes answered 15/4, 2011 at 15:48 Comment(0)
N
0

could that be a permission issue? did you set right permission in the manifest? maybe the emulator is not so strict on lack of permissions (I've experienced that sometimes, some devices worked and other didn't, and all I was missing was a manifest permission)

you have to set both

 <permission
        android:name="your.packagename.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

and

<uses-permission android:name="your.packagename.matchtracker.permission.C2D_MESSAGE" />

in the main section of your manifest and declare a brodcast receiver with

<receiver
            android:name=".push.RegistrationReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="your.packagename" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="your.packagename" />
            </intent-filter>
        </receiver>
Niggard answered 23/5, 2012 at 15:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.