Skip to content

Commit 9afbd4c

Browse files
committed
fix canRequestPermission to be the answeredPrompt property
* The public API `canRequestPermission` which returns if the native dialog will appear is better suited to return `answeredPrompt` instead of `hasPrompted`. * Cases may be the app quits before the user chooses a permission, or the permission prompt is swiped away.
1 parent bd5dfa7 commit 9afbd4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignalNotifications/OSNotificationsManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ + (BOOL)permission {
228228
}
229229

230230
+ (BOOL)canRequestPermission {
231-
return !self.currentPermissionState.hasPrompted;
231+
return !self.currentPermissionState.answeredPrompt;
232232
}
233233

234234
+ (void)requestPermission:(OSUserResponseBlock)block {

0 commit comments

Comments
 (0)