'Xamarin Push Notification Firebase Android 12 (exported)

i would like to implement the GettingStarted from the Package Github. So far so good if i do everything like in the Tutorial im getting the Error "Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]" for the crc640921eac73192168e.PNMessagingService. That means i have to add Code to the Manifest.xml with the property exported=true or false. But i cant figure out which Code i have to paste in the XML to make it work properly? In a furhter Question from another User Stackoverflow he got the answer for setting exported = false but he dont said which the exact code has to be, maybe so can help me :D



Solution 1:[1]

Put the this into receiver of the AndroidManifest.xml file. This is the Receiver of this plugin. You need to put this inside the <application> tag.

<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
    <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" 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>

For more details, you could check the AndroidManifest.xml of the sample for this plugin.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Wendy Zang - MSFT