iosxcodereact-nativekiosk-modeguided-access

Check if kiosk mode is enable ( Guided access)


I have a reactnative application, i want to check if the user enable or not the kiosk mode (Guided Access)

How we can check if user has enable Kiosk mode programmatically ?

I found nothing on the internet, Any help will be apprecied


Solution

  • I add on didFinishLaunchingWithOptions [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(guidedAccessStatusChanged) name:UIAccessibilityGuidedAccessStatusDidChangeNotification object:nil];

    -(void) guidedAccessStatusChanged {
    
    if (UIAccessibilityIsGuidedAccessEnabled()) {
      [Connexion consumeCallBackCompoTrainEnableAccess : @"true"];
    }  else {
      [Connexion consumeCallBackConduiteEnableAccess : @"false"];
      
    } 
    

    }

    + (void) consumeCallBackConduiteEnableAccess : (NSString *) hasAcess {
    
       if(callbackStockConduite != nil && callbackStockConsommedConduite == false && [hasAcess isEqualToString:@"false"]){
    
    callbackStockConsommedConduite = true;
    callbackStockConduite(@[hasAcess]);
    
    }
    

    }

    This callbackStockConduite is used by reactnative