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
The type returned by
PushNotificationIOS.requestPermissions(...)
isPushNotificationPermissions
which has a propertyauthorizationStatus
. The real type of theauthorizationStatus
property is a number but the TS type has it as an interface.Currently, I have to do this to bypass the TypeScript error: