LocalCast has been removed from Google Play.
Update: There is a discussion with someone from Google in the comments.
I jumped the gun yesterday and pushed an update without the permission, before I got a reply from Google Play.
What the docs are currently missing:
If you use a foreground service it will avoid certain parts of doze, not just App Standby.
Issue regarding doze + foreground service + sensor data:https://code.google.com/p/android/issues/detail?id=193802
There is no word in the docs if the foreground service keeps the device from entering doze idle state with an active network connection, but from my testing it seems like it doesn't.
Actually it's a good thing to make sure that only apps which really need to deactivate the battery optimization are allowed to do this, but removing the whole app from Google Play, really?
"Hello Google Play Developer,
We reviewed LocalCast for Chromecast/DLNA, de.stefanpledl.localcast, and found that it violates Google Play Developer Program Policy.
This app has been removed from Google Play and won’t be available to users until you submit a compliant update.
Your app was removed for ineligible declaration of android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS.
This violates our dangerous products policy.
They will reply within 72h, if my appeal is denied, then I can upload the app without the permission. So it will be back soon.