- Added a
disconnect()
function- There seems to be an issue with re
connect()
ing after adisconnect()
- Workaround is to just create a new
SwordRPC
object
- There seems to be an issue with re
- Changed timestamps to use integer seconds
- The Discord API expects timestamps to be integer, and will behave strangely if passed a non-integer value
- Presence update requests to the API are made when the presence is changed, instead of every 15 seconds
- Presence updates on startup are now much faster
- The Discord API handles the 15 second update frequency limit for us
- Updated some deprecated functions for compatibility with Swift 5
- Fixed a crash that would occur upon connecting to the Discord API
- The
.details
and.state
properties ofRichPresence
are nowString?
instead ofString
.- This is because the JSON Encoder generates
"details": ""
for an emptyString
, which appears to break the Discord API. Using an optionalString
, the key-value pair is not encoded at all.
- This is because the JSON Encoder generates
connect()
returns aBool
indicating whether or not the connection was successful
- macOS, Linux
- Swift 5.0
This fork uses Swift Package Manager.
In your Xcode project, go to Swift Packages in your Project Settings and add the package with URL https://github.com/PKBeam/SwordRPC.git
.