This app seems like a good idea. It detects when your in a moving vehicle and turns off notifications.
I think ios11 had it built in.
https://play.google.com/store/apps/details?id=mk.com.vasilev.drivingdetective
I think ios11 had it built in.
https://play.google.com/store/apps/details?id=mk.com.vasilev.drivingdetective