Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Android Firebase Notification in Manifest?

I'm trying to setup Firebase notifications. I did changes in app level and root level build.gradle. But still, its giving me error in Manifest for MyFirebaseMessagingService. Error is Unresolved Class.

<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">


        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".s" />
    <activity android:name=".im" />
    <activity android:name=".Main2Activity" />
    <activity android:name=".sactivity" />
    <service
        android:name=".MyFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
    </service>
    <activity
        android:name=".ScrollingActivity"
        android:label="@string/title_activity_scrolling"
        android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

like image 577
coolamz Avatar asked Sep 24 '16 15:09

coolamz


1 Answers

Looks like the Android Manifest file can't locate the MyFirebaseMessagingService class. I'd suggest you to put the fully qualified package name of the class. See example below:

    <service android:name="com.android.notification.MyFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
like image 73
looptheloop88 Avatar answered Sep 28 '22 13:09

looptheloop88