Reapplied #3097, which was originally applied to the release-ios-v3.0.0 branch but was omitted in a merge back to master.
default