Search code examples
iosswiftpush-notificationapple-push-notificationsonesignal

"Cannot find type 'OSPermissionSubscriptionState in scope" error when using oneSignal with swift


I started using oneSignal by one of tutorials. And when typing let status: OSPermissionSubscriptionState = OneSignal.getPermissionSubscriptionState() i'm getting error Cannot find type 'OSPermissionSubscriptionState'. I don't know why it's happening because i founded this code in the documentation of oneSignal in User Status methods.


Solution

  • Use Onegnal.getDeviceState() instead of getPermissionSubscriptionState. You can follow this documentation.