Praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
A Muslim should avoid swearing by Allah unnecessarily since He the Almighty says {What means}: "And make not God’s (name) an excuse in your oaths against doing good, or acting rightly, or making peace between persons; for God is One Who heareth and knoweth all things."{Al-Baqarah, 224}. He also says {What means}:" But keep to your oaths."{Al-Ma`idah, 89}. Whoever swore by Allah unto someone to do something, then the addressee should fulfil that oath, but if he didn`t, then the ruling of Sharia in this regard depends on the intention of the person taking the oath:
First: If his intention was that the addressee fulfills his oath and bind him by it, then the person taking the oath is liable for the kaffara of breaking an oath.
Second: If his intention is/isn`t to make the addressee the one swearing by Allah; rather, he meant Allah`s intercession, then this isn`t considered an oath, and neither the person taking the oath nor the addressee is liable for the Kaffara of breaking an oath.
Imam Al-Shirbini said: "If a person swore by Allah unto someone to do something and his intention was to make the addressee fulfill his oath, then it is binding, and it is recommended for the addressee to fulfill it; of course, this is provided that the oath doesn`t involve doing something forbidden or reprehensible. Thus, if the addressee didn`t fulfill that oath, then the person making the oath is liable for the Kaffara of breaking an oath. However, if his intention was/wasn`t to make the addressee the one taking the oath; rather, he meant Allah`s intercession, or he took that oath without having any intention behind it whatsoever, then in all these cases, it isn`t considered an oath. This is because neither he nor the addressee have sworn by Allah." {Moghni Al-Mohtaj, Vol.6:P.186}.
In conclusion, if most people intended the second case mentioned above, then they aren`t liable for the Kaffara of breaking an oath. And Allah the Almighty knows best.