React-native-permissions: [iOS] Background App Refresh permission

Created on 12 Mar 2020  路  4Comments  路  Source: zoontek/react-native-permissions

Question

I'm wondering if it's possible to access the permission state of Background App Refresh within an apps settings.
Screen Shot 2020-03-12 at 9 58 50 AM

question

All 4 comments

@mcgomez Hi 馃憢 Not as I know!

https://stackoverflow.com/a/19138393/9910298

if ([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusAvailable) {

    NSLog(@"Background updates are available for the app.");
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusDenied)
{
    NSLog(@"The user explicitly disabled background behavior for this app or for the whole system.");
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusRestricted)
{
    NSLog(@"Background updates are unavailable and the user cannot enable them again. For example, this status can occur when parental controls are in effect for the current user.");
}

@mikehardy It could be checked, but not requested. We should add it anyway.

https://github.com/jamesisaac/react-native-background-task#statusasync

https://github.com/transistorsoft/react-native-background-fetch/ (status method)

I would not add it, react-native-background-fetch is a module I personally use and is well-maintained, since it's not a permission I'd stay focused with this module and tell people to use that one

Was this page helpful?
0 / 5 - 0 ratings