Skip to content

Commit b1bfd03

Browse files
authored
Merge branch 'discord:main' into main
2 parents 8504a4b + d6a8cba commit b1bfd03

File tree

5 files changed

+103
-22
lines changed

5 files changed

+103
-22
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "Discord Social SDK Release 1.3"
3+
date: "2025-06-05"
4+
topics:
5+
- "Discord Social SDK"
6+
---
7+
8+
A new release of the Discord Social SDK is now available, with the following updates:
9+
10+
### Authentication
11+
- Added an `APPLICATION_DEAUTHORIZED` webhook event which can be configured in the developer portal. When a user unlinks their account or revokes authorization for your application in any way, this event will be sent to configured webhooks. The payload will contain serialized user information. See [Webhook Events](/docs/events/webhook-events) docs for more information on configuring webhook events.
12+
13+
### PC
14+
- Added configurable request timeout SDK HTTP client requests to mitigate crashing when connected to unstable/slow internet. Support is on PC in this release with console and mobile support coming in future release. Timeout default value is 30000ms (30 seconds) and can be configured using the new Client API: [`Client::SetHttpRequestTimeout`]
15+
16+
### Mobile
17+
- [`Client::SetSpeakerMode`] is now deprecated. Unless [`Client::SetEngineManagedAudioSession`] is used, audio routing will be handled automatically by the SDK
18+
19+
#### Android
20+
- Fixed routing of game and voice audio when external audio devices are connected and/or disconnected. [`Client::SetEngineManagedAudioSession`] has been added to communicate that the SDK should not manage audio routing and automatically enter and leave `MODE_IN_COMMUNICATION` when joining and leaving calls.
21+
- Fixed an issue with the Authorize method when a device configuration change needs to restart the activity
22+
23+
#### iOS
24+
- Various fixes for audio routing and session management. When using the Unity plugin, game audio will no longer stop playing when ending a call. For standalone SDK use, a method [`Client::SetEngineManagedAudioSession`] has been added to communicate that the SDK should not automatically start and stop the `AVAudioSession` when joining and leaving calls.
25+
- Corrected supported platform values in `Info.plist` for iOS .frameworks.
26+
27+
### Consoles
28+
- Standalone archives now only contain console-specific files, like the Unity and Unreal Engine archives
29+
30+
### Misc
31+
- Fixed a thread safety issue with [`Client::AddLogCallback`]
32+
- Added [Flags] declaration for bit flags enums in C#
33+
34+
<!-- Autogenerated Reference Links -->
35+
[`Client::AddLogCallback`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af78996cff24a40f5dc7066beed16692c
36+
[`Client::SetEngineManagedAudioSession`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ade08897214152b9acfa79c263e77e366
37+
[`Client::SetHttpRequestTimeout`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ae5fe2518b0b1b05ee1745ab0a79096b9
38+
[`Client::SetSpeakerMode`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ac269ab57407e3b83e2bb2d30895e666d

docs/discord-social-sdk/getting-started/using-unity.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Let's set up your Unity project to include the Social SDK package and add the ne
5151

5252
1. Create a new 2D project in Unity Hub using Unity version 2021.3 or later
5353
2. Either:
54-
1. Unzip the zip file in the `Packages` folder, or
55-
2. Unzip the zip file to a temporary location, and [Install Package from Disk](https://docs.unity3d.com/Manual/upm-ui-local.html) from the temporary location.
54+
1. Unzip the zip file in the Unity `Packages` folder, or
55+
2. Unzip the zip file and [Install Package from Disk](https://docs.unity3d.com/Manual/upm-ui-local.html). Make sure the folder is in a directory that won't get moved or deleted as your Unity project will load it from that location.
5656
3. In your project add a `Scripts` folder and create a `DiscordManager.cs` script
5757
4. Add the following code to `DiscordManager.cs`:
5858
```cs

docs/events/webhook-events.mdx

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,12 @@ The table below includes the different webhook event types your app can subscrib
132132

133133
The "Value" column corresponds to the event's `type` field value in the [event body object](/docs/events/webhook-events#event-body-object).
134134

135-
| Name | Value | Description |
136-
|------------------------------------------------------------------------------|--------------------------|------------------------------------------------------------------------|
137-
| [Application Authorized](/docs/events/webhook-events#application-authorized) | `APPLICATION_AUTHORIZED` | Sent when an app was authorized by a user to a server or their account |
138-
| [Entitlement Create](/docs/events/webhook-events#entitlement-create) | `ENTITLEMENT_CREATE` | Entitlement was created |
139-
| [Quest User Enrollment](/docs/events/webhook-events#quest-user-enrollment) | `QUEST_USER_ENROLLMENT` | User was added to a Quest (currently unavailable) |
135+
| Name | Value | Description |
136+
|----------------------------------------------------------------------------------|----------------------------|------------------------------------------------------------------------|
137+
| [Application Authorized](/docs/events/webhook-events#application-authorized) | `APPLICATION_AUTHORIZED` | Sent when an app was authorized by a user to a server or their account |
138+
| [Application Deauthorized](/docs/events/webhook-events#application-deauthorized) | `APPLICATION_DEAUTHORIZED` | Sent when an app was deauthorized by a user |
139+
| [Entitlement Create](/docs/events/webhook-events#entitlement-create) | `ENTITLEMENT_CREATE` | Entitlement was created |
140+
| [Quest User Enrollment](/docs/events/webhook-events#quest-user-enrollment) | `QUEST_USER_ENROLLMENT` | User was added to a Quest (currently unavailable) |
140141

141142
#### Application Authorized
142143

@@ -175,6 +176,35 @@ The "Value" column corresponds to the event's `type` field value in the [event b
175176
}
176177
```
177178

179+
#### Application Deauthorized
180+
181+
`APPLICATION_DEAUTHORIZED` is sent when the app is deauthorized by a user.
182+
183+
###### Application Deauthorized Structure
184+
185+
| Field | Type | Description |
186+
|-------|----------------------------------------------------------------|-------------------------------|
187+
| user | [user object](/docs/resources/user#user-object-user-structure) | User who deauthorized the app |
188+
189+
###### Application Deauthorized Example
190+
191+
```json
192+
{
193+
"version": 1,
194+
"application_id": "1234560123453231555",
195+
"type": 1,
196+
"event": {
197+
"type": "APPLICATION_DEAUTHORIZED",
198+
"timestamp": "2024-10-18T14:42:53.064834",
199+
"data": {
200+
"user": {
201+
// user data
202+
}
203+
}
204+
}
205+
}
206+
```
207+
178208
#### Entitlement Create
179209

180210
`ENTITLEMENT_CREATE` is sent when an [entitlement](/docs/resources/entitlement) is created when a user purchases or is otherwise granted one of your app's SKUs. Refer to the [Monetization documentation](/docs/monetization/overview) for details.

docs/topics/opcodes-and-status-codes.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,24 @@ Our voice gateways have their own set of opcodes and close codes.
7777

7878
###### Voice Close Event Codes
7979

80-
| Code | Description | Explanation |
81-
|------|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
82-
| 4001 | Unknown opcode | You sent an invalid [opcode](/docs/topics/opcodes-and-status-codes#voice-voice-opcodes). |
83-
| 4002 | Failed to decode payload | You sent an invalid payload in your [identifying](/docs/events/gateway-events#identify) to the Gateway. |
84-
| 4003 | Not authenticated | You sent a payload before [identifying](/docs/events/gateway-events#identify) with the Gateway. |
85-
| 4004 | Authentication failed | The token you sent in your [identify](/docs/events/gateway-events#identify) payload is incorrect. |
86-
| 4005 | Already authenticated | You sent more than one [identify](/docs/events/gateway-events#identify) payload. Stahp. |
87-
| 4006 | Session no longer valid | Your session is no longer valid. |
88-
| 4009 | Session timeout | Your session has timed out. |
89-
| 4011 | Server not found | We can't find the server you're trying to connect to. |
90-
| 4012 | Unknown protocol | We didn't recognize the [protocol](/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-select-protocol-payload) you sent. |
91-
| 4014 | Disconnected | Channel was deleted, you were kicked, voice server changed, or the main gateway session was dropped. Should not reconnect. |
92-
| 4015 | Voice server crashed | The server crashed. Our bad! Try [resuming](/docs/topics/voice-connections#resuming-voice-connection). |
93-
| 4016 | Unknown encryption mode | We didn't recognize your [encryption](/docs/topics/voice-connections#transport-encryption-and-sending-voice). |
94-
| 4020 | Bad request | You sent a malformed request |
80+
| Code | Description | Explanation |
81+
|------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
82+
| 4001 | Unknown opcode | You sent an invalid [opcode](/docs/topics/opcodes-and-status-codes#voice-voice-opcodes). |
83+
| 4002 | Failed to decode payload | You sent an invalid payload in your [identifying](/docs/events/gateway-events#identify) to the Gateway. |
84+
| 4003 | Not authenticated | You sent a payload before [identifying](/docs/events/gateway-events#identify) with the Gateway. |
85+
| 4004 | Authentication failed | The token you sent in your [identify](/docs/events/gateway-events#identify) payload is incorrect. |
86+
| 4005 | Already authenticated | You sent more than one [identify](/docs/events/gateway-events#identify) payload. Stahp. |
87+
| 4006 | Session no longer valid | Your session is no longer valid. |
88+
| 4009 | Session timeout | Your session has timed out. |
89+
| 4011 | Server not found | We can't find the server you're trying to connect to. |
90+
| 4012 | Unknown protocol | We didn't recognize the [protocol](/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-select-protocol-payload) you sent. |
91+
| 4014 | Disconnected | Disconnect individual client (you were kicked, the main gateway session was dropped, etc.). Should not reconnect. |
92+
| 4015 | Voice server crashed | The server crashed. Our bad! Try [resuming](/docs/topics/voice-connections#resuming-voice-connection). |
93+
| 4016 | Unknown encryption mode | We didn't recognize your [encryption](/docs/topics/voice-connections#transport-encryption-and-sending-voice). |
94+
| 4020 | Bad request | You sent a malformed request |
95+
| 4021 | Disconnected: Rate Limited | Disconnect due to rate limit exceeded. Should not reconnect. |
96+
| 4022 | Disconnected: Call Terminated | Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect. |
97+
9598

9699
## HTTP
97100

0 commit comments

Comments
 (0)