Trump was booed in New York as he became first US president to attend the NBA Finals.