Home Blog Page 2

reactjs – iOS keyboard glints and autofill recommendations reappear when toggling password visibility in React Native


I am constructing a login display in React Native utilizing commonplace TextInput elements for the username and password fields. On iOS, when the consumer faucets the attention icon to toggle password visibility (secureTextEntry on/off), the keyboard briefly hides and exhibits once more, and the iCloud Keychain autofill bar reappears.

This causes the display to flicker visually, particularly when wrapped in a KeyboardAvoidingView, making the structure leap. The problem additionally occurs when switching focus between inputs—even with out toggling visibility—so long as autofill has been triggered a minimum of as soon as.

This conduct would not occur on Android and appears tightly tied to iOS keyboard and autofill conduct.

Code pattern (minimal repro):

import { useState } from "react";
import {
  KeyboardAvoidingView,
  Platform,
  StyleSheet,
  Textual content,
  TextInput,
  TouchableOpacity,
  View,
} from "react-native";
import { Feather } from "@expo/vector-icons";

export default operate App() {
  const [username, setUsername] = useState("");
  const [password, setPassword] = useState("");
  const [showPassword, setShowPassword] = useState(false);

  return (
    
      
        Username
        
      
      
        Password
        
          
           setShowPassword((prev) => !prev)}
            model={types.icon}
          >
            
          
        
      
    
  );
}

const types = StyleSheet.create({
  container: { flex: 1, justifyContent: "middle", padding: 20 },
  row: { marginBottom: 20 },
  enter: {
    borderWidth: 1,
    borderColor: "#ccc",
    padding: 10,
    borderRadius: 6,
  },
  inputWrapper: { place: "relative" },
  icon: { place: "absolute", proper: 10, prime: 10 },
});

What I attempted:

I set autoComplete=”off” and textContentType=”none” on the inputs, however iOS nonetheless exhibits the Keychain autofill bar.

I additionally tried rendering two separate TextInputs (one with secureTextEntry, one with out), and switching between them—however that made the glint even worse.

Tried utterly eradicating KeyboardAvoidingView and managing keyboard manually. No enchancment.

What I anticipated:

The keyboard ought to keep secure and never cover/present when toggling visibility.

As soon as the consumer dismisses the Keychain autofill bar, it ought to keep hidden.

No flicker or structure leap when switching focus between fields.

High Veracode Options for Cell App Safety in 2025


In terms of cellular software safety testing instruments, Veracode has lengthy been a preferred alternative for builders in search of robust options to guard their apps from vulnerabilities. 

Visualizing analysis within the age of AI



An unique {photograph} taken by Felice Frankel (left) and an AI-generated picture of the identical content material. Credit score: Felice Frankel. Picture on proper was generated with DALL-E

By Melanie M Kaufman

For over 30 years, science photographer Felice Frankel has helped MIT professors, researchers, and college students talk their work visually. All through that point, she has seen the event of assorted instruments to help the creation of compelling pictures: some useful, and a few antithetical to the hassle of manufacturing a reliable and full illustration of the analysis. In a current opinion piece printed in Nature journal, Frankel discusses the burgeoning use of generative synthetic intelligence (GenAI) in pictures and the challenges and implications it has for speaking analysis. On a extra private notice, she questions whether or not there’ll nonetheless be a spot for a science photographer within the analysis neighborhood.

Q: You’ve talked about that as quickly as a photograph is taken, the picture will be thought of “manipulated.” There are methods you’ve manipulated your individual pictures to create a visible that extra efficiently communicates the specified message. The place is the road between acceptable and unacceptable manipulation?

A: Within the broadest sense, the choices made on find out how to body and construction the content material of a picture, together with which instruments used to create the picture, are already a manipulation of actuality. We have to keep in mind the picture is merely a illustration of the factor, and never the factor itself. Choices need to be made when creating the picture. The crucial subject is to not manipulate the info, and within the case of most pictures, the info is the construction. For instance, for a picture I made a while in the past, I digitally deleted the petri dish by which a yeast colony was rising, to deliver consideration to the beautiful morphology of the colony. The information within the picture is the morphology of the colony. I didn’t manipulate that knowledge. Nevertheless, I all the time point out within the textual content if I’ve finished one thing to a picture. I talk about the thought of picture enhancement in my handbook, “The Visible Parts, Pictures”.

A picture of a rising yeast colony the place the petri dish has been digitally deleted. Such a manipulation could possibly be acceptable as a result of the precise knowledge has not been manipulated, Frankel says. Picture credit score: Felice Frankel

Q: What can researchers do to verify their analysis is communicated appropriately and ethically?

A: With the appearance of AI, I see three fundamental points regarding visible illustration: the distinction between illustration and documentation, the ethics round digital manipulation, and a unbroken want for researchers to be skilled in visible communication. For years, I’ve been making an attempt to develop a visible literacy program for the current and upcoming lessons of science and engineering researchers. MIT has a communication requirement which largely addresses writing, however what concerning the visible, which is not tangential to a journal submission? I’ll guess that almost all readers of scientific articles go proper to the figures, after they learn the summary.

We have to require college students to learn to critically take a look at a broadcast graph or picture and determine if there’s something bizarre happening with it. We have to talk about the ethics of “nudging” a picture to look a sure predetermined means. I describe within the article an incident when a pupil altered one in every of my pictures (with out asking me) to match what the coed wished to visually talk. I didn’t allow it, after all, and was upset that the ethics of such an alteration weren’t thought of. We have to develop, on the very least, conversations on campus and, even higher, create a visible literacy requirement together with the writing requirement.

Q: Generative AI isn’t going away. What do you see as the long run for speaking science visually?

A: For the Nature article, I made a decision {that a} highly effective solution to query the usage of AI in producing pictures was by instance. I used one of many diffusion fashions to create a picture utilizing the next immediate:

“Create a photograph of Moungi Bawendi’s nano crystals in vials in opposition to a black background, fluorescing at totally different wavelengths, relying on their measurement, when excited with UV mild.”

The outcomes of my AI experimentation have been usually cartoon-like pictures that might hardly move as actuality — not to mention documentation — however there will probably be a time when they are going to be. In conversations with colleagues in analysis and computer-science communities, all agree that we must always have clear requirements on what’s and isn’t allowed. And most significantly, a GenAI visible ought to by no means be allowed as documentation.

However AI-generated visuals will, in reality, be helpful for illustration functions. If an AI-generated visible is to be submitted to a journal (or, for that matter, be proven in a presentation), I consider the researcher MUST:

  • clearly label if a picture was created by an AI mannequin;
  • point out what mannequin was used;
  • embody what immediate was used; and
  • embody the picture, if there may be one, that was used to assist the immediate.


MIT Information

AI Information Facilities: Addressing Rising Energy Calls for


The AI revolution is in full swing, and which means much more knowledge facilities; trade specialists predict a 33% enhance within the variety of knowledge facilities by the tip of the last decade. And with that enhance will come a rise in electrical energy utilization. Some states may see knowledge facilities account for as a lot as 36% of their complete electrical energy consumption inside the coming decade, in accordance with EPRI’s latest load-growth situations. This AI-driven energy demand will add to the substantial strain on electrical energy grids already vulnerable to being overtaxed. In keeping with many specialists, the truth is, AI might be accountable for a coming power disaster.

Nevertheless, that disaster will be averted with the adoption of on-site thermal power storage methods, which permit for extra versatile utilization of power with out operational sacrifices to the always-on knowledge middle. Thermal power methods can instantly scale back knowledge facilities’ pressure on the grid, thus decreasing the incidence of brownout or blackouts, together with the necessity for added utility-level infrastructure–a value that might inevitably be handed onto shoppers of their energy payments. In the end, such storage methods may pave the best way for extra knowledge facilities coming on-line sooner to fulfill rising demand for AI with out making a major affect on group power infrastructure.

Thermal power methods relieve strain on the grid primarily as a result of they permit for load-shifting, or the adjustment of the hours throughout which the info facilities use essentially the most electrical energy from the grid. Information facilities can cost these storage methods with grid energy throughout the hours when grid demand is decrease, then launch it to energy operations throughout the hours when utilities  are extra strained by general larger demand from shoppers. Information facilities’ utilizing such  methods to retailer power for and energy AC methods alone could make a giant distinction  as a result of cooling methods should run 24/7 to maintain essential gear from overheating, and infrequently make up some 40% of a middle’s energy utilization.  

The International AI Race Is Set to Require Massive Quantities of Power

The not too long ago introduced $500 billion Stargate Mission, led by a bunch of main tech firms, goes to wish dozens of gigawatts of electrical energy. As Chinese language startup DeepSeek AI not too long ago confirmed, AI could certainly turn into extra environment friendly concerning price and power, however many specialists count on AI to stay a major supply of excessive energy demand.  

In actual fact, even earlier than these AI bulletins, knowledge facilities had been on observe to more and more problem US power provide. In keeping with the U.S. Power Data Administration, energy consumption is about to rise to report highs in 2025, with knowledge middle energy wants an vital issue.

In keeping with specialists, over the subsequent decade knowledge middle energy calls for will put greater than half of North America vulnerable to experiencing energy reductions and even blackouts. Even the place there’s sufficient energy, knowledge facilities are set to have a monetary affect on everybody; research present that knowledge middle demand and the following squeeze on assets may drive electrical energy costs up by as a lot as 70%. A Bain & Firm temporary highlights how surging knowledge middle demand may threaten to overhaul utility provide development and require trillions of {dollars} in new power investments globally. In keeping with Bain, “Velocity to market is important for knowledge middle suppliers,” however native communities and regulators fear about grid reliability and environmental impacts.

Thermal Power Storage Is an Fast Answer That Advantages All Stakeholders

That is the place thermal power storage—a expertise obtainable now—might help. Designed to be used with common utility-provided electrical energy, power is saved in water or ice, and launched when wanted to energy the info facilities’ cooling methods – often in periods when demand – and likewise pricing – is excessive. This resolution doesn’t require making a significant infrastructure change; it may be retrofitted to current buildings. Because it’s a behind-the-meter resolution, knowledge facilities can set up them unbiased of utilities – that means that it’s a fast and environment friendly strategy to relieve the grid. 

If  used extensively, such methods can decrease the probability of brownouts or blackouts throughout occasions of general excessive demand. This load shifting will probably be particularly vital in states the place energy demand will probably be particularly excessive for knowledge facilities.  Options like thermal power storage that assist flatten the online grid affect present utilities with extra respiration room to combine new assets, together with photo voltaic and wind energy,  and increase transmission in an orderly vogue. Such options additionally scale back or at the very least decelerate the necessity for utilities to increase infrastructure—potenitally decreasing prices that might finally be handed onto shoppers by way of their energy payments.  

With a confirmed resolution to cut back pressure on the grid, new knowledge facilities will doubtless be capable to achieve obligatory authorities approvals and working permits sooner, with much less opposition or fear about staining native energy sources, permitting this sector to develop sooner and sustain with the growing demand introduced by AI.

Why Information Facilities Ought to Act Now

There may be additionally a monetary profit for knowledge facilities that incorporate thermal power storage methods: With extra utilities utilizing differential pricing or time-of-use tariffs, primarily based on demand or supply of that power, behind-the-meter storage can reap the benefits of these gaps in pricing, that are set to extend much more sooner or later, particularly in states like California and others which are extra reliant on photo voltaic power throughout the day. Information facilities can get monetary savings by charging the thermal system throughout the hours when  energy when it’s cheaper, and releasing it throughout peak hours – enabling them to cut back reliance on grid energy at its extra pricey hours.

Thermal power storage can also be a safer choice for knowledge facilities than lithium-ion battery-based storage. Whereas small Li-On batters are widespread amongst residential shoppers, giant buildings like knowledge facilities would require giant batteries, which current vital issues of safety. The batteries typically can not maintain a cost for greater than 12 hours. Additionally they degrade with time and require vital pure assets, together with minerals, that are in brief provide and sourced abroad. Many batteries are additionally made abroad, together with in China, whereas thermal power methods are primarily U.S.-made.

AI will convey many advantages – in addition to challenges. The power required to run a big knowledge middle consuming 100 MW of energy, research present, may provide some 80,000 properties with electrical energy. Multiply that by the various new knowledge facilities coming on-line and the affect is critical – one that might push costs up for everybody, in addition to result in power shortages, brownouts, and even blackouts. AI is about to convey trillions in added worth to the financial system – however energy points may damage that anticipated productiveness. It doesn’t should be that approach; by adopting thermal power options, the info middle trade can decrease its bills and scale back the prospect of blackouts. 

Flutter : ❗️Concern: Mic will not be activating after resuming the recording after iOS telephone/voip name interruption – AVFAudio error -10868


Platform: iOS

Flutter model: 3.29.3

Packages used:

  • file: ^6.0.0
  • audio_session: ^0.2.1

✅ Anticipated Behaviour

  • Microphone Availability Examine
  • Earlier than beginning or resuming recording, examine if the microphone is already in use by one other app.
  • If unavailable, show a dialog: “Microphone is at the moment in use by one other software.”
  • Background Recording Assist
  • Permit ongoing recordings to proceed even when the app is shipped to the background, guaranteeing persistent audio seize.
  • Automated Interruption Dealing with
  • Cellphone/VOIP Name Interruption: Robotically pause recording when a telephone or VOIP (e.g., WhatsApp, Groups) name is acquired or ongoing.
  • System Focus Modes:
    • Pause recording if the system is in a spotlight mode (like Do Not Disturb) and the microphone will not be obtainable.
    • Resume recording by person manually ought to solely resume if mic is accessible.
    • Resume mechanically if interruption ends.
  • Auto Resume Recording
  • Robotically resume recording as soon as the interruption (name or focus mode) ends, sustaining the session seamlessly.

❌ Precise Behaviour

  • You acquired a Groups name whereas recording was on-going.
  • Whereas a Groups name is ringing (not accepted), the recording continues and the mic orange dot stays energetic.
  • Whenever you declined the decision, the recording paused mechanically (on account of an “interruption occasion”)
  • Whenever you tried to renew recording, the microphone labored briefly however then stopped
  • After pausing and making an attempt to renew once more, you acquired the error: PlatformException(file, The operation could not be accomplished. (com.apple.coreaudio.avfaudio error -10868.), null, null)

🔁 Steps to Reproduce the Concern

  • Begin recording within the app (orange mic indicator seems)
  • Obtain an incoming Groups name (recording continues)
  • Decline the Groups name (recording mechanically pauses on account of interruption dealing with)
  • Try and resume recording (microphone works briefly then fails)
  • Pause recording manually
  • Try and resume recording once more (error -10868 seems)

🔍 Associated Code Snippets

  1. Arrange the recorder and audio session throughout initialisation within the initState methodology.
/*
   _initialiseRecorderController is used to initialize recorder controller and audio session
   */
  void _initialiseRecorderController() async {
    _audioRecorder = AudioRecorder();
    _session = await AudioSession.occasion;
    await _configureAudioSession();
  }
  1. Configure the audio_session
Future _configureAudioSession() async {
    strive 
              AVAudioSessionCategoryOptions.allowBluetoothA2dp  catch (e) {
      debugPrint("_configureAudioSession error : ${e.toString()}");
    }
  }
  1. The toggle recording operate is triggered from the recorder button throughout the construct methodology.
/*
   _toggleRecording is operate that begins the recording if the
   microphone request is granted and request permission if not.
   */
  Future _toggleRecording() async {
    strive {
      bool isMicrophoneAvailable = await _checkMicrophoneAvailability();
      if (!isMicrophoneAvailable) {
        await _showMicrophoneUnavailableDialog();
        return;
      }
      if (await Permission.microphone.isGranted) {
        if (_isRecordingStarted) {
          await _resumePauseRecording();
        } else {
          await WakelockPlus.allow();
          await _startRecording();
        }
      } else {
        ultimate bool isPermissionGranted = await ServiceUtils.requestPermission(
          Permission.microphone,
        );
        if (isPermissionGranted) {
          await _toggleRecording();
        }
      }
    } catch (e) {
      debugPrint("_toggleRecording error : ${e.toString()}");
    }
  }
  1. Examine microphone availability each at first and when resuming recording.
Future _checkMicrophoneAvailability() async {
    strive {
      if (_isMicrophoneInUse && Platform.isAndroid) {
        debugPrint("Microphone is at the moment in use by one other app.");
        return false;
      }
      ultimate bool isActive = await _requestAudioFocus();
      if (!isActive) {
        await _session.setActive(false);
        debugPrint("Microphone is unavailable. One other app is utilizing it.");
        return false;
      }
      return true;
    } catch (e) {
      await _session.setActive(false);
      debugPrint("Error checking microphone availability: ${e.toString()}");
      return false;
    }
  }
  1. Begin the recording
/*
  _startRecording operate calls the _startBackupRecording with the beginning
  of the foreground service and connecting to the socket
   */
  Future _startRecording() async {
    strive {
      _meetingStartTime = DateTime.now().millisecondsSinceEpoch;
      _startForegroundTask();
      await _socketConnection();
      _recordDuration = 0;
      _startTimer();
      await _startBackupRecording();
      setState(() {
        _isRecording = true;
        _isRecordingStarted = true;
        _isRecordingCompleted = false;
      });
    } catch (e) {
      debugPrint("_startRecording error : ${e.toString()}");
    }
  }

/*
  _startBackupRecording begins the recording utilizing startStream and
  _recordStream is listened so as to add audio knowledge to the _recordedData constantly
  and a _backupTimer is began for creating 30 secs chunk file
   */
  Future _startBackupRecording() async {
    strive {
      await _configureAudioSession();
      bool energetic = await _requestAudioFocus();
      if (!energetic) return; // Forestall beginning if focus not acquired
      await _handleAudioInterruptions();
      _recordStream = await _audioRecorder.startStream(
        const RecordConfig(
          encoder: AudioEncoder.pcm16bits,
          sampleRate: 22000,
          numChannels: 1,
          // bluetoothSco: true,
          autoGain: true,
        ),
      );
      _recordStream?.hear((occasion) {
        _recordedData.add(occasion);
      });
      _startBackupTimer();
    } catch (e) {
      debugPrint("Error startBackupRecording: ${e.toString()}");
    }
  }

  1. Request audio focus
/*
  _requestAudioFocus is used to request audio focus when app begins recording
   */
  Future _requestAudioFocus() async {
    strive {
      return await _session.setActive(
        true,
        avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.notifyOthersOnDeactivation,
      );
    } catch (e) {
      return false;
    }
  }
  1. Deal with Audio Interruption
/*
  _handleAudioInterruptions is used to detect and deal with interruptions when one other app makes use of microphone
   */
  Future _handleAudioInterruptions() async {
    _recordInterruptionSubscription = _session.interruptionEventStream.hear((occasion) async {
      if (occasion.start) {
        setState(() {
          _isMicrophoneInUse = true;
        });
      } else {
        setState(() {
          _isMicrophoneInUse = false;
        });
      }
    });
  }
  1. Resume And Pause the recording
/*
   _resumePauseRecording is used to renew and pause the recording.
   When paused the _recordDuration _timer and _backupTimer is stopped.
   When resumed the _recordDuration _timer and _backupTimer is began once more.
   */
  Future _resumePauseRecording() async {
      if (_isRecording) {
        // pause recording
      } else {
        // resume recording
      }
  }
  /*
   _resumeRecording is used to renew the recording.
   When resumed the _recordDuration _timer and _backupTimer is began once more.
   */
  Future _resumeRecording() async {
    strive {
      await _configureAudioSession(); // 🔁 reconfigure session earlier than resuming
      bool energetic = await _requestAudioFocus();
      if (!energetic) {
        return;
      }
      await Future.delayed(Durations.medium1);
      await _audioRecorder.resume();
      _startTimer();
      _startBackupTimer();
      setState(() {
        _isRecording = true;
        _isPause = false;
        _isManuallyPause = false;
      });
    } catch (e) {
      
    }
  }
/*
   _pauseRecording is used to pause the recording and add that a part of chunk file.
   When paused the _recordDuration _timer and _backupTimer is stopped.
   */
  Future _pauseRecording({
    bool isManuallyPause = false,
  }) async {
    strive {
      _timer?.cancel();
      _backupTimer?.cancel();
      await _audioRecorder.pause();
      setState(() {
        _isRecording = false;
        _isPause = true;
        _isManuallyPause = isManuallyPause;
      });
    } catch (e) {
      debugPrint("Error _pauseRecording: ${e.toString()}");
    }
  }
  1. Cease the recording
/*
  _stopRecording stops the recording and stops the foreground service
   */
  Future _stopRecording() async {
    strive {
      await _audioRecorder.cease();
      _timer?.cancel();
      _stopForegroundTask();
      // Add a brief delay earlier than deactivating the session
      await Future.delayed(const Period(milliseconds: 200));
      await _deactivateAudioSession();
      setState(() {
        _isRecording = false;
        _isRecordingStarted = false;
        _isPause = false;
        _isManuallyPause = false;
        _isRecordingCompleted = true;
        _isMicrophoneInUse = false;
      });
    } catch (e) {
      debugPrint("Error stopping the recording: ${e.toString()}");
    }
  }
  1. Deactivate Audio Session
Future _deactivateAudioSession() async {
    strive {
      await _session.setActive(
        false,
        avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.notifyOthersOnDeactivation,
      );
    } catch (e) {
      debugPrint("Error deactivating audio session: ${e.toString()}");
    }
  }

🔄 Workaround Tried

  • Manually deactivating and reactivating the session.
  • Reinitializing the audio recorder occasion.
  • Including an extended delay earlier than resuming.
  • Re-requesting focus with setActive(true).

❓ Questions

  • Is there any iOS-specific workaround for resuming the mic after a
    declined VoIP name?
  • Is that this anticipated conduct in iOS or an edge case of audio session
    state administration?