Player boundaries based on screen resolution

Hello, so I have a 2D mobile game. I have a player that you move by dragging it, but the problem right now is that you can drag it out of the screen. Now my problem is how do I set up player boundaries for multiple screen resolutions? If anyone knows how to do that it will be great, thank you!

You can get the camera dimensions at runtime and use that. See here

If using a perspective camera, you can get the pixel Width/Height and use ScreenToWorldPoint