简体   繁体   中英

Registering but not receiving push notifications on Android

I'm running an sample application on AIR using EasyPush extension from milkman games, and using urban airship as 3rd party server.

In IOS everything works fine, but in Android I'm not receiving the push notification. I can register the token, it appears on project menu in my urban airship account, but when i send a test message, i'm not receiving it on device.

I've checked many times my android manifest xml, but everything seems to be ok.

<manifestAdditions><![CDATA[
        <manifest android:installLocation="auto">
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
            <uses-permission android:name="android.permission.GET_TASKS"/>
            <uses-permission android:name="android.permission.WAKE_LOCK"/>
            <uses-permission android:name="android.permission.VIBRATE"/>

            <permission android:name="air.com.cafundo.testpush.permission.C2D_MESSAGE" android:protectionLevel="signature" />
            <uses-permission android:name="air.com.cafundo.testpush.permission.C2D_MESSAGE" />
            <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

            <uses-sdk android:minSdkVersion="8"/>
            <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>

            <application>
                <activity android:name="air.com.cafundo.testpush.PushPreferencesActivity" />
                <activity android:name="air.com.cafundo.testpush.LocationActivity" />

                <receiver android:name="com.urbanairship.CoreReceiver" />

                <receiver android:name="com.urbanairship.push.GCMPushReceiver" android:exported="true" 
                          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.cafundo.testpush" />
                    </intent-filter>

                    <intent-filter>
                        <action android:name="android.intent.action.PACKAGE_REPLACED" />
                        <data android:scheme="package"/>
                    </intent-filter>
                </receiver>

                <service android:name="com.urbanairship.push.PushService" android:label="Push Notification Service"/>
                <service android:name="com.urbanairship.analytics.EventService" android:label="Event Service"/>

                <provider android:name="com.urbanairship.UrbanAirshipProvider"
                    android:authorities="air.com.cafundo.testpush.urbanairship.provider"
                    android:exported="false"
                    android:multiprocess="true" />

                <receiver android:name="air.com.cafundo.testpush.IntentReceiver" />                 
                <receiver android:name="com.milkmangames.extensions.android.push.MmgPushReceiver" />

            </application>

        </manifest>

    ]]></manifestAdditions>

Hope somebody can help me.

Thanks.

I'm not sure if you're still having this issue, but I made the mistake of creating a Key for Android applications when I should've been creating a Key for server applications within the Google developers console.

As soon as I used the generated server API key within UrbanAirship's "Configure Notification Services / Google Cloud Messaging (GCM)" section I started to receive the push messages.

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM