-
Notifications
You must be signed in to change notification settings - Fork 49
Description
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