Comment by Someone

6 hours ago

If they allow apps to provide that message from code, that is very hard to test for, even for Apple.

Shady developers would try very hard to get past such checks, for example by changing that message based on the date, IP address range, nearby WiFi networks, receipt of a payload, etc.

They could introduce an optional string-valued entitlement and check its text. That would be a lot easier but still require them to translate messages.

For the iOS permissions I know of (Camera, etc), the message comes from the Info.Plist in the .app bundle, not from code.