CrossGeeks / FirebasePushNotificationPlugin

Firebase Push Notification Plugin for Xamarin iOS and Android
MIT License
395 stars 178 forks source link

android:exported attribute missing in manifest. Unusable on Android 12 (will be rejected by playstore) #411

Open innomotionmedia opened 2 years ago

innomotionmedia commented 2 years ago

Hi,

the attribute android:exported is missing.

This is the manifest after build:

<receiver android:name="crc6494e14b9856016c30.PushNotificationActionReceiver" />
<receiver android:name="crc6494e14b9856016c30.PushNotificationDeletedReceiver" />

This needs to have android:exported="false" or "true" for it to be acceptable by the playstore.

This is a big issue!

innomotionmedia commented 2 years ago

The only solution rn is to add this line manually to the manifest inside appliaction tags:

R3muSGFX commented 2 years ago

The only solution rn is to add this line manually to the manifest inside appliaction tags:

@innomotionmedia you need to analyze the AndroidManifest.xml file that is created by Xamarin. I've managed to make a workaround to this issue by adding the following lines in the AndroidManifest.xml present in your android project, under the application tag:

<!-- Necessary for Plugin.FirebasePushNotification -->
        <service android:name="crc6494e14b9856016c30.PNFirebaseMessagingService" android:exported="true" tools:node="merge">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

Hope this helps.

vhugogarcia commented 2 years ago

Thanks @R3muSGFX for providing a workaround. It fixed the issue.

feduke-nukem commented 2 years ago

The only solution rn is to add this line manually to the manifest inside appliaction tags:

@innomotionmedia you need to analyze the AndroidManifest.xml file that is created by Xamarin. I've managed to make a workaround to this issue by adding the following lines in the AndroidManifest.xml present in your android project, under the application tag:

<!-- Necessary for Plugin.FirebasePushNotification -->
      <service android:name="crc6494e14b9856016c30.PNFirebaseMessagingService" android:exported="true" tools:node="merge">
          <intent-filter>
              <action android:name="com.google.firebase.MESSAGING_EVENT" />
          </intent-filter>
      </service>

Hope this helps.

Solution works, but only problem is that when Android 12.0 device receives notification - app crashes.

R3muSGFX commented 2 years ago

The only solution rn is to add this line manually to the manifest inside appliaction tags:

@innomotionmedia you need to analyze the AndroidManifest.xml file that is created by Xamarin. I've managed to make a workaround to this issue by adding the following lines in the AndroidManifest.xml present in your android project, under the application tag:

<!-- Necessary for Plugin.FirebasePushNotification -->
        <service android:name="crc6494e14b9856016c30.PNFirebaseMessagingService" android:exported="true" tools:node="merge">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

Hope this helps.

Solution works, but only problem is that when Android 12.0 device receives notification - app crashes.

@coccyx-cyst If you look on the issue I've posted (https://github.com/CrossGeeks/FirebasePushNotificationPlugin/issues/409) I've pointed out the exact issues present at the moment and how we treated them.