OnBecameInvisible Not Working Real Device

Hello,

I have implemented OnBecameInvisible() and attached the script to my game object. I have added a renderer and got it working, but only when I use the unity editor? The function is never called when I am using a real device such as my android phone. Why is this? Do I need to adjust other settings, such as the camera?

This may not be the answer for everyone but I have figured out my issue. I changed my canvas render mode to screen space - camera. Apparently that function never gets called when using screen space - overlay, at least to my knowledge I could not figure out how to get it to work. I did also have to resize the camera to the size of the view so that way the camera did see the objects and when they left. I assumed when screen space - overlay was used, the camera would automatically see anything that comes in and leaves. This does not seem to be the case?