@Lola230 Reread my post. I didn't say that it was unthinkable not to provide the code 24 hours in advance. I can fully understand why some hosts find this a good way to handle check-in, especially if they've had guests arrive early in the past, assuming they can just check in.
I was saying that it might not be okay to do this with all guests and that a host should consider being flexible, depending on the circumstances. Personally, I don't like leaving things to the last minute, or to chance. What if a guest lost their phone, or it's out of juice and they haven't had anywhere to plug it in?. What if they're from an older generation that isn't that adept at using a smart phone and doesn't use texting?
And you wouldn't need to ask a hotel for the key 24 hours before checking in because there would always be someone at the hotel to hand you the key when you arrive.