Building a Reusable Mobile OS Permission Layer in UE5—Best Practices?

We’re a central tech team building a reusable abstraction layer in UE5 to check and set various OS permissions on mobile (including push notifications). Required functionalities include:

  • Check OS permission status (sometimes async)
  • Request push notification permission

What are the recommended best practices for implementing these permission dialogs at runtime and ensuring a unified workflow across iOS and Android? Does Unreal Engine provide any built-in or partially supported framework for this, or should we rely on third-party plugins or custom native code? Any specific solutions or examples would be greatly appreciated.

Hi Cherie,

Can you provide more examples of which types of permissions this layer would need to handle? This is rather broad as not all permissions are explicitly requested by mobile application’s runtime.

UE5 does have existing platform agnostic APIs to requiest notifications permissions ([iOS|Android]PlatformMisc::RegisterForRemoteNotifications). However, other permissions such as say, camera/mic, network access, are requested via PList/entitlements or AndroidManifest for which runtime can only handle the permission’s ‘granted’ status.

For iOS, you can provide a custom entitlements file to UE via the

[/Script/MacTargetPlatform.XcodeProjectSettings] PremadeIOSEntitlements=(FilePath="/Game/path/to/entitlements")As well as add text to the application Property List via the ‘Additional PList Data’ entry under Project Settings -> Platforms -> iOS -> Build rubrick.

Similarly on Android, additional tags may be added to the generated AndroidManifest.xml via Project Settings -> Platforms -> Android -> Advanced APK Packaging -> Extra Tags for …

Best regards.

Hi Michelle,

A few options to integrate your native mobile framework are:

1 . drop the code directly in the game project

2 . build the external code as static libraries and link it to the game project (https://dev.epicgames.com/documentation/en\-us/unreal\-engine/integrating\-third\-party\-libraries\-into\-unreal\-engine)

3 . for Android Java, .java files or .jar’s can be added to the project and code can be invoked via JNI from native game side code or a linked static library.

Best regards..

Hi Daniele,

There are no specific plans a mobile OS permission layer on this end. As such, should you choose to pursue internally, it wouldn’t be superseded by EU. However, we’d be happy to consider a feature request for 5.7 if you wished to go that route.

Best regards.

Hi Stéphane,

I’m on the team that requested Cherie’s team take on this work.

To give you context, on other projects we have written native mobile code (eg java and ObjC) to trigger the OS permissions flow at a better time than on first app open, before we can provide a value proposition/explain why we want the permission. This follows both Apple and Google’s best practices for permission requests, which is especially important for a feature like push notifications that is easy for apps to abuse and is often auto-denied by users. For our desired UX flow, the app needs to be able to query the OS to get the current permission status (the values differ between OSes and versions with an OS, but eg. ‘Haven’t asked’, ‘Granted’, ‘Denied’), and also be able to trigger the permission request flow if we’re in a valid state.

If this isn’t a usecase where Unreal has an exposed API already, perhaps a more general starting question might be ‘what’s the standard way to interface with mobile native code in an Unreal project’?

Hi Stephane!

I had a follow up question on this stuff.

Is Epic planning any improvement to your mobile OS permission layers? And if so, what and when?

I wanted to make sure that if we invest on this internally, we won’t be doing lots of throw away work that will be superseded by UE upgrades.

Thanks!