"You are about to leave…" prompts in mobile apps?

Related to Should actions that leave your app require confirmation? but not quite the same question...

Some native mobile apps present a confirmation prompt when a user action will take them out of the app (e.g. launching navigation directions in Google Maps / Apple Maps; opening a URL out-of-app in the native device browser etc.). However, most apps don't do this.

I'm guessing that it could help some users in some situations but not others (e.g. Most of the time it's unnecessary and gets in the way, but [these] types of users found it helpful in situations such as [x], [y] and [z] because of [this reason].

I'm sure plenty of people can offer opinions as to whether such prompts are A Good Thing or not, but does anyone have any personal experience of user testing this approach, or know of any related research?