Safe Area API
Get safe area insets using the WebToNative JavaScript API. Retrieve safe area heights to adjust UI components and avoid overlaps with system areas like the notch or home indicator.
window.WTN.getSafeArea({
callback: function(data){
//Contains data of the safe area settings
}
});
//Response Data
{
"type":"getSafeArea",
"top" : 150,
"bottom" : 102,
"topSafeArea": true/false,
"bottomSafeArea": true/false
}import { getSafeArea } from "webtonative"
getSafeArea({
callback: function(data){
//Contains data of the safe area settings
}
});
//Response Data
{
"type":"getSafeArea",
"top" : 150,
"bottom" : 102,
"topSafeArea": true/false,
"bottomSafeArea": true/false
});Response / Return Values
Field
Type
Example
Platform
Description
Last updated