Mobile Notifications Permission Status Problem

Unable to find the UserPermissionToPost

8680242--1170153--upload_2022-12-22_16-51-24.png

Have you made sure that you’re using the latest Mobile Notifications package?
This API didn’t exist < 2.1.0. So check your package manager whether it is up to date or not.

I’ve tried it in a project using Unity 2021.3.16 LTS and it works fine to me.

using Unity.Notifications.Android;
using UnityEngine;

public class NotificationComponent : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        var permission = AndroidNotificationCenter.UserPermissionToPost;
    }
}

If you’re not receiving any errors in the console but the red line persists, you’ll need to regenerate the csproj files.
Edit > Preferences > External Tools > Regenerate project files

8680695--1170246--upload_2022-12-22_13-36-45.png

Thx a lot, i need to update my unity version and the package version