Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object literal may only specify known properties, and 'inAppNotificationSettings' does not exist in type 'IOSNotificationPermissions' #1029

Open
HardikGaur opened this issue Apr 23, 2024 · 1 comment

Comments

@HardikGaur
Copy link

I am using notifee in my react native application. I am trying to use the method

notifee.requestPermission({
inAppNotificationSettings:true
})

This is giving me a typescript error

Object literal may only specify known properties, and 'inAppNotificationSettings' does not exist in type 'IOSNotificationPermissions'

In the documentation Permission Settings it is mentioned we can use this property, but in the typescript definition of the object that this function takes, the above property is missing. The typescript definition of requestpermission is as given below

requestPermission(permissions?: IOSNotificationPermissions): Promise<NotificationSettings>;

And the IOSNotificationPermissions is defined as

export interface IOSNotificationPermissions {

    alert?: boolean;

    criticalAlert?: boolean;

    badge?: boolean;

    sound?: boolean;

    carPlay?: boolean;

    provisional?: boolean;

    announcement?: boolean;
}

As we can see the above type definition does not have anything for inAppNotificationSettings. This variable is defined in another type definition which also contains other properties that we can pass to requestPermission().

export interface IOSNotificationSettings {

    alert: IOSNotificationSetting;

    badge: IOSNotificationSetting;

    criticalAlert: IOSNotificationSetting;

    showPreviews: IOSShowPreviewsSetting;

    sound: IOSNotificationSetting;

    carPlay: IOSNotificationSetting;

    lockScreen: IOSNotificationSetting;

    announcement: IOSNotificationSetting;

    notificationCenter: IOSNotificationSetting;

    inAppNotificationSettings: IOSNotificationSetting;

    authorizationStatus: AuthorizationStatus;
}

I believe that the type definition of the object that requestPermission() accepts should be IOSNotificationSettings instead of IOSNotificationPermissions

Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant