According to an interview (credits to reddit for the source) with the author, Makoto Shinkai asked for permission to use McDonalds within his works. After some time, his request was granted.
You feature McDonald’s at one point. Did you want to convey the city in an almost photo-real way?
MAKOTO SHINKAI: I wasn’t aiming for photo-realism, but I did want the audience to recognise the places and recognise that this Tokyo is the place where they live. For global corporations like McDonald’s, there are actually a lot of restrictions about featuring them in animation. You need permission, for example, if you want to draw their logo. I approached McDonald’s Japan and asked them if I could feature McDonald’s in my film, because I thought it was essential as part of the real Tokyo that I wanted to show. They initially refused because there is a gun in the film, but I went back several times and I eventually managed to convince them.