I guess it is all in the definition of "demand." I interpret the word -- at least in this context -- to mean it has legal teeth, so to speak.
Even if they are enforcing their demand by way of banning users that don't comply, that may indeed be illegal. For instance, if Facebook made a demand that gay people may not declare themselves so on the platform or they will be banned, I'm sure they'd pretty quickly find themselves on the wrong side of the law.
But really, right now, something like this just gives Congress new things to grill Zuckerberg on, next time they bring him in. (which is inevitable, I think)
It does not have teeth, but it would if the developer agreed to cease and desist. It’s an offer; in return they will not sue. (From what they might propose to abstain from suing, I am not sure. And whether that agreement would be a valid contract for certainty and completeness is another issue. But the general idea is “stop this or we will sue; if you do stop we won’t sue”.)
The threat of a lawsuit counts as "teeth," to me. But only if it is significant likelihood that the lawsuit will be successful.
So the way I tend to interpret things is a bit less pedantic: "can they demand?" means (to me) "do they have a way of forcing compliance that is likely be backed by a court?"
This does have the effect of making the word "demand" less of a binary and more of a gray scale.
A fun thing about the law is that nobody cares about your interpretations of "demand" and "legal teeth, so to speak". The only important thing is that it was in fact framed as an offer: "demanded that I agree". The original question was:
> How is this legal in any shape or form?
And the answer is, any person or corporation has the power to make an offer not to sue. Consider this post a legally binding offer from me to you, not to sue you for any matter arising out of your reply to my comment. I demand thirty thousand US dollars for the covenant not to sue. You don't have to accept, but if you don't, or you agree but do not pay within 60 days, I reserve the right to sue.
You don't need any more authority or legal power than the power to contract. There is zero legal difference between what Facebook did, and what I just did. If you don't want to accept, I cannot make you. Facebook's negotiating position is only better because they have better lawyers, more money to waste on frivolous lawsuits, and the developer maybe felt they might have done something wrong.
Even if they are enforcing their demand by way of banning users that don't comply, that may indeed be illegal. For instance, if Facebook made a demand that gay people may not declare themselves so on the platform or they will be banned, I'm sure they'd pretty quickly find themselves on the wrong side of the law.
But really, right now, something like this just gives Congress new things to grill Zuckerberg on, next time they bring him in. (which is inevitable, I think)