Yes and no. Laws on when you must identify yourself to officers varies wildly from state to state but social media isn't a part of that. Lawfully refusing will usually be enough, but there are cops who don't care and will arrest you for obstruction (watch YT channels like Audit the Audit, it happens all the time). It looks like this article is about LAPD cops adding this to information they ask for, just like they ask where you're going or if they can look around the car. Just assert your 5th amendment rights and decline to answer questions.
That being said, if you ever end up in court your social media activity is pretty much always discoverable. This is different from an officer demanding it during a traffic stop but still important. It is all accessible.
That being said, if you ever end up in court your social media activity is pretty much always discoverable. This is different from an officer demanding it during a traffic stop but still important. It is all accessible.