firebase / firebase/firebase-unity-sdk

[FR]: Don't require a custom AndroidManifest.xml. Make required changes via 'IPostGenerateGradleAndroidProject'

Open
#1,089 1 comment 0 reactions 0 assignees View on GitHub
api: messaging type: feature request
Dominant language
C#
Stars
320
Forks
60
Avg merge
11h 15m
Merged PRs (30d)
11

Description

### Description

Hey there

1. We perform all our manifest modifications via IPostGenerateGradleAndroidProject. This allows all plugins to play nicely with each other and inject what they need into the manifest themselves. It means we dont have to create a custom manifest and we always use the 'default unity one' which means we're always on the latest manifest whenever we update Unity, too.
2. Firebase messaging requires a custom AndroidManifest. It wants to change the activity name and it wants to add a service. This means that the manifest is now 'hardcoded' to whatever state it is in that version of Unity.
3. Firebase should scan the android manifest in IPostGenerateGradleAndroidProject to look for the presence of the required Service and add or replace it if needed. Firebase should replace the activity name with its own one _if the user opted in for this functionality_. This can default to **true**, and more advance users can disable it if they wish. Though, as long as firebase's IPostGenerateGradleAndroidProject order/priority is low enough, advanced users can always write their own 'IPostGenerateGradleAndroidProject' with a higher order/priority and stomp over Firebases changes. (This is to support the use case of custom activity names. We already do this in our project since we have a custom activity and manually inherit MessagingUnityPlayerActivity)

### API Proposal

No API changes required.

### Firebase Product(s)

Messaging

### Targeted Platform(s)

Android

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.