Skip to content

[Question] How to use MessagingOptions.SuppressNotificationPermissionPrompt (iOS)? #1342

@DevMassive

Description

@DevMassive

What is your question?

I would like to control when the iOS notification permission dialog is shown in my Unity app.
According to the release notes for Firebase Unity SDK 5.0.0, there is support for suppressing the automatic permission prompt at startup:

"Messaging: Added an optional initialization options struct. This can be used to suppress the prompt on iOS that requests permission to receive notifications at start up. Permission can be requested manually using the function FirebaseMessaging.RequestPermissionAsync()."

I found that there is a property Firebase.Messaging.MessagingOptions.SuppressNotificationPermissionPrompt.
However, I cannot find any way to pass this MessagingOptions to Firebase Messaging, since the Messaging API does not expose an explicit initialization function.

  • How should MessagingOptions be used in Unity?
  • Is there an official way to disable the automatic prompt and only call RequestPermissionAsync() manually?

Firebase Unity SDK Version

12.8.0

Unity editor version

2022.3.41f1

Installation Method

Unity Package Manager

Problematic Firebase Component(s)

Messaging

Other Firebase Component(s) in use

No response

Additional SDKs you are using

No response

Targeted Platform(s)

Apple Platforms

Unity editor platform

Mac

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions