I am happy this was brought up. I have been approached by companies to add in "SDKs" of this sort. They usually offer to pay you per user. When you have scale, these companies while the app is open can scan for other media they need to link. I have witnessed iOS apps processing web ads, tv stations and radio ads. The freakiest was watching the software understand a tv show was playing, detect which show, then off a competing ad in the app.
It is quite amazing what a phone can absorb while sitting in a living room with a loud tv blaring (which is most of america).
See more: https://www.audiblemagic.com/ (Edit, you will see "Facebook" as one of their customers.....)