Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

FCM Push Notifications are not being received on Android device

ataylor

HI:

I am converting from using GCM to FCM for Urban Airship Push Notifications. I am using Xamarin and have followed all the steps in the documentation, and all of the troubleshooting steps check out.

Push Notifications sent from the Firebase console arrive on the device.

Here is my Autopilot

namespace Guess.Droid
{
    [Register("Guess.Droid.GuessAutopilot")]
    public class GuessAutopilot : Autopilot
    {

      public override void OnAirshipReady(UAirship airship)
      {
        // perform any post takeOff airship customizations
      }

      public override AirshipConfigOptions CreateAirshipConfigOptions(Context context)
      {
            var options = new AirshipConfigOptions.Builder()
                .SetDevelopmentAppKey("7RMJeVmYQ0OPZFfiAHkgVA")
                .SetDevelopmentAppSecret("M_WGYydyQ6aV1sbKJfyuUA")
                .SetProductionAppKey("aQ7Gt71GSaSE8hqyoNNKIQ")
                .SetProductionAppSecret("48EffVaTT6aOcHt4Q7HsmQ")
#if DEBUG
                .SetInProduction(false)
#else
                .SetInProduction(true)
#endif
                .SetFcmSenderId("122480123450")
                .SetLogLevel(4)
                .Build();

            return options;
        }
    }
}

 

and my manifest:

 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.alert.guess" android:versionCode="1952" android:versionName="5.8.1">
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="${applicationId}.permission.UA_DATA" />
    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <permission android:name="${applicationId}.permission.UA_DATA" android:protectionLevel="signature" />
    <application android:label="GUESS 81" android:largeHeap="true" android:icon="@drawable/icon">
        <uses-library android:name="org.apache.http.legacy" android:required="false" />
        <uses-feature android:name="android.hardware.location.network" />
        <service android:name=".widget.RichPushWidgetService" android:permission="android.permission.BIND_REMOTEVIEWS" android:exported="false" />
        <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
        <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:enabled="true" 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="${applicationId}" />
            </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="${applicationId}.urbanairship.provider" android:exported="true" android:multiprocess="true" android:permission="${applicationId}.permission.UA_DATA" />
        <service android:name="com.urbanairship.richpush.RichPushUpdateService" />
        <service android:name="com.urbanairship.location.LocationService" android:label="Segments Service" />
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    </application>
</manifest>

 

Do you have any guidance on how to troubleshoot the problem?

 

Thanks,

Tony Milici

 

Please sign in to leave a comment.