There are certain portions of my app that would be better to highlight to the user if they're on the phone.
Is there a call to check to see if we're on the phone? Unfortunately, "call" is a horrible word to check for in API documents for obvious reasons.
Even if you're cautious about what information you reveal online, it's possible someone could stalk you via apps installed on your smartphone. Stalking apps (also known as spyware and stalkerware) are apps that someone can download onto your phone to secretly track you.
Take a look at the difference in size between [[UIScreen mainScreen] bounds]
and [[UIScreen mainScreen] applicationFrame]
. If the diff is 20 pixels and you aren't hiding the status bar, then the users probably isn't on a call. If the difference is 40 pixels, your users is probably on a call, since the glowing green status bar that appears during calls is about twice as big as the normal status bar.
I haven't done this before, so YMMV. Good luck and let me know if it works!
The CoreTelephony Framework can tell you.
The CTCallCenter currentCalls method returns a set of currently active cellular calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With