Son funciones curiosas y estan sin probar aún.
Funcion SetIdLETimer() y getIdleTimer() activa desactiva y mira el estado del autoreposo.
Función setproximimonitor() comprueba si el dispositivo tiene sensor de proximidad , sino lo tiene nos da un aviso , si lo tiene lo activa o desactiva segun el parametro pasado .
Funcion phoneCall() llama al número de telefono pasado como parametro ( ojo texto).
Saludos.
Code: Select all | Expand
HB_FUNC( SETIDLETIMER ){[[UIApplication sharedApplication] setIdleTimerDisabled:hb_parnl( 1 )];}HB_FUNC( GETIDLETIMER ){hb_retl( [[UIApplication sharedApplication] isIdleTimerDisabled] );}HB_FUNC( SETPROXIMONITOR ){UIDevice *device = [UIDevice currentDevice];device.proximityMonitoringEnabled = YES;if (device.proximityMonitoringEnabled == YES){[ device setProximityMonitoringEnabled:hb_parnl( 1 )];}else{Msginfo("Dispositivo sin sensor de proximidad")}}HB_FUNC( PHONECALL ){ NSString *ctelf = [ [ [ NSString alloc ] initWithCString: ISCHAR( 1 ) ? hb_parc( 1 ) : "" ] autorelease ]; NSString *cURL = [ [ [ NSString alloc ] initWithCString: "tel:" ] autorelease ]; cURL = [cURL stringByAppendingString:ctelf ];NSURL *phoneNumberURL = [NSURL URLWithString: cURL ];[[UIApplication sharedApplication] openURL:phoneNumberURL];}