Just another remark: calling sync() does not trigger an App Store login prompt. At least not on macOS...
Topic:
App & System Services
SubTopic:
StoreKit
Tags: