iPhones do not have as aggressive battery optimizations as Android. On the other hand, it is possible to disable the battery optimizer and it is necessary to check that all permissions are properly enabled. This is detailed in the tutorials below.
Select the iOS version corresponding to your iPhone to get the tutorial.