I once brought some fresh porcini mushrooms to my friends' place - we're sitting, eating, making soup, and one guy just keeps glued to his phone the whole time. So I just took his phone and put it in another room and said: "40 minutes without this, then we'll give it back". Turns out he wasn't even against it, he was just used to holding the gadget in his hands on autopilot. So yeah, a direct conversation is the foundation, but not just hints, be specific: "Listen, when you're on your phone, it feels like you're not interested in hanging out with me. It upsets me because I'm setting aside time for this." Honest talk helps better than letting resentment build up.
But I agree there could be a second reason - someone pointed out correctly above that maybe the hangouts are just boring. Try suggesting something specific: not just "let's meet up", but "let's go check out that new exhibition" or "let's play pool". An activity distracts from the phone way better than just sitting on the couch. I notice myself that when I'm walking through the forest with someone looking for mushrooms, nobody looks at their screens - there's just no time for that.
If after a direct conversation and offering some cool stuff to do nothing changes - okay then, maybe it makes sense to reconsider this friendship. But don't rush into it, first really try everything honestly.