Methods 1.

wx.getSystemInfo({
  success: function(res) {
    // Match according to the phone model
    if (res.model.search('iPhone X') != -1
    || res.model.search('iPhone Max') != -1 
    || res.model.search('iPhone 11') != -1
    || res.model.search('iPhone 12') != -1) {
      console.log('Yes full screen')}}})Copy the code

Method 2,

// Use iPhone env() and constant() padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);Copy the code