Now the screen mirroring does not appear on my iphone or my ipad.
AirPlay has an on|off setting in Apple TV: Settings﹥AirPlay﹥. Verify that it is on.
All devices involved should connect to the same home network. Verify that. (iPhone on cellular wouldn’t help.)
Apple TV (3rd generation) needs to be activated with an Apple ID account, else AirPlay may not be functional.
If activation failed, then that should be listed in: Settings﹥General﹥About﹥…
Use AirPlay to stream video or mirror the screen of your iPhone or iPad - Apple Support
If screen mirroring or streaming isn't working on your AirPlay-compatible device - Apple Support
Some apps and streaming services may have a block on AirPlay, or require a later model receiving device. See their respective websites for details on AirPlay compatibility. (This should not affect the discovery of AirPlay devices though.)