I noticed the same issue as well. On Fedora, just having "include /etc/sway/config.d/*" in your Sway config would set this variable correctly and allow screensharing.
For Debian, I put the following in my Sway config and it solved it: exec dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP=sway