Skip to content

Incorrect TS type for authorizationStatus in PushNotificationPermissions #196

Closed
@cmrigney

Description

@cmrigney

The type returned by PushNotificationIOS.requestPermissions(...) is PushNotificationPermissions which has a property authorizationStatus. The real type of the authorizationStatus property is a number but the TS type has it as an interface.

Currently, I have to do this to bypass the TypeScript error:

const permission = await PushNotificationIOS.requestPermissions(...)
const authorized = ((permission.authorizationStatus as any) as number) === PushNotificationIOS.AuthorizationStatus.UNAuthorizationStatusAuthorized

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions