I have been playing Minecraft for a while and have noticed today that as a ps4 player with my friend who plays on the iPad, we can play together in his world and we tried it the other way around, so that he plays with me in my ps4 world and I'm not even shown to him on the iPad that I'm in a world, what do I have to do?
You have to add him as a friend. You both need a Microsoft account. You can do this in the bottom right corner of the screen if you are in the main menu. To add you as a friend I think you have the Xbox app, but maybe you can also use Minecraft.
Are already friends and I will not be shown to him as online
Are you logged into Minecraft and maybe you accidentally switched to offline viewing?
No everything normal
Then unfortunately I can't help you either. Try to contact Microsoft Support.