Discord Social SDK
|
The standalone C++ SDK is a header-only wrapper over the underlying C API provided by the shared library. To include the necessary implementation code, do this in exactly one C++ file in your codebase:
#define DISCORDPP_IMPLEMENTATION
before including discordpp.h
. In the rest of your codebase, you can include discordpp.h
normally. You should also link the shared C library into your program.
See the Discord SDK Getting Started Guides for step-by-step installation instructions for C++.
The Unreal and Unity SDKs are plugins that wrap the C++ SDK and provide a more idiomatic interface for each engine.
See the Discord SDK Getting Started Guides for step-by-step installation guides for each engine.
The Unreal and Unity plugins generally match the standalone C++ API documented here, but note that there a few Unity-specific extra configuration options on the NativeMethods
static class within the plugin:
UseSynchronizationContext
: When true (by default), callbacks from the SDK will be posted to the synchronization context and run on the Unity game thread. If you disable this, callbacks will be run directly on the thread they originate from, typically an internal client thread in the SDK.UnhandledException
: This event will be called if there is an unhandled exception thrown by an SDK callback. By default, exceptions will be written to the Unity debug log via Debug.LogException
.Debugging symbols are hosted at https://storage.googleapis.com/discord-public-symbols. If using Visual Studio, you can add this link to the pdb locations under Tools > Options > Debugging > Symbols.
NOTE: You won’t be able to browse files using that link, but that’s ok. Individual files are accessible under the domain and the URL will function properly as a symbol server, so it will work in Visual Studio.