Last month Apple announced plans to allow developers to sell Mac and iOS apps as a single "Universal Purchase," which means that by buying one version, you'll get access to the other one automatically. That tool has now launched officially, and also supports in-app purchases.
Developers only need to change the bundle identifier on their Mac app to the same one as their iOS app, and the App Store will take care of the rest. As Apple explains, "First create a single in-app purchase under the Features tab in App Store Connect, then use StoreKit to implement the in-app purchase in the various platform versions of your app."
As 9to5Mac notes, however, there aren't yet any applications that support Universal Purchase between Mac and iOS. "This is because Apple has not yet made the Xcode 11.4 GM available to developers."
The introduction of Universal Purchase is part of Apple's ongoing Project Catalyst initiative, which the company announced in 2019. Its main objective, according to a Bloomberg report from last year, is to eventually allow developers to merge their iPhone, iPad and Mac applications into a single app.