Texture2D.readPixels not working on iOS?

The following code is quite straightforward:

Texture2D tex = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);
tex.ReadPixels( new Rect(0, 0, Screen.width, Screen.height), 0, 0, false);
tex.Apply();

This works great in the Unity editor, and it works on my iPhone to a certain extent, meaning that it captures what the camera is picking up, but it does not capture any 3D content that I have displaying on the screen.

In other words:

Unity editor: it captures all 3D content in front of the background
iOS: it only captures the background

Any thoughts?

It captures from active render texture as far as I remember. Maybe your background texture is set as active. Try setting RenderTexture.active = null and do the capture then.

My problem is that I wasn’t waiting for the end of the current frame before grabbing the pixels. Sorry about that.