Open SandeepAggarwal opened 7 years ago
same for me, were you able to resolve?
@royherma Yes, I was able to use a workaround to solve this issue:
//setOnAuthChange: is not being called (bug) so this workaround
@weakify(permissionScope);
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note)
{
@strongify(permissionScope);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)),
dispatch_get_main_queue(), ^
{
if ([permissionScope statusNotifications] == PermissionStatusUnauthorized ||
[permissionScope statusNotifications] == PermissionStatusDisabled)
{
if (deniedOrDisabledBlock)
{
deniedOrDisabledBlock();
}
}
else
{
if (authorizedBlock)
{
authorizedBlock();
}
}
});
[[NSNotificationCenter defaultCenter] removeObserver:self];
}];
OnAuthChange block is not getting called in case of notification permission