In iOS, how do I avoid the notch?

hi,
I want to make sure the canvas doesn’t go over the notch. now, my canvas is set for fit height, so I know the canvas will cover the entire screen. what I have done is have my graphics in a node which is a child of the canvas and I set the widget of that node in the following way:

var frameSize = cc.view.getFrameSize();
var visibleSize = cc.view.getVisibleSize();
var bgNode = cc.find(“Canvas/JOIN_BG”);

var topMarginPercentage = (frameSize.height - visibleSize.height)*1.0/frameSize.height;
var widgetComp = bgNode.getComponent(cc.Widget);
widgetComp.top = topMarginPercentage;
widgetComp.isAbsoluteTop = false;
widgetComp.updateAlignment();

this code is displaying the graphics in a way that avoids the notch , but starts much lower than the bottom line of the notch. first of all I would like to know if frame size and visible size are cocos design sizes or screen sizes. I have a feeling frame size is screen size and visible size is cocos design size, and that may be causing the problem.
need help!