Can't connect my iphone to mac keynote as a remote
So i wanted to use my iPhone 12 Pro Max as a remote control to my keynote on mac, both are on the same wifi network, but they just don't connect , the soft says that my iPhone is unavailable, i have to connect them both on the same network, but they are already on the same network . I get my phone name in the list of remotes , i click and nothing happens, just an error . How can i fix this problem?
MacBook Pro 13″, macOS 11.5