Social (Unity)
FRVRSDK.Social wraps the host channel’s share sheet and invite picker. Two actions: share (broadcast to the player’s feed / friends) and invite (target specific friends directly).
Not every channel supports these — always check first.
Check support
Section titled “Check support”If canInvite is false, hide the UI entry point — don’t show a button that does nothing.
Share a screenshot
Section titled “Share a screenshot”The wrapper takes a base64 data URL for the image. Capture the texture, encode to PNG, base64‑encode the bytes, prefix with the data‑URL scheme:
With structured entrypoint data (so the receiving player lands in a specific state):
The result callback is Action<int> — 1 means the host accepted the share, 0 means it failed (often “user closed the sheet without sharing”).
| Argument | Type | Required | Purpose |
|---|---|---|---|
text | string | yes | Body / description text. |
image | string | yes | Image as a base64 data URL (data:image/png;base64,…). |
headline | string | yes | Short headline above the body, where supported. |
cta | string | yes | Call‑to‑action button label. |
result callback | Action<int> | yes | 1 on success, 0 on failure / cancel. |
entryPointDataJson | string (JSON) | no | Serialized payload delivered to the recipient via entry point on join. Defaults to "{}". |
Invite specific friends
Section titled “Invite specific friends”The host channel presents its native friend picker; the callback fires when the player finishes or cancels. Like Share, the result is Action<int> — 1 on success, 0 on cancel/failure. Note that entryPointDataJson is positional (5th argument), comes before the callback, and is required on Invite (unlike Share, which defaults it to "{}").
| Argument | Type | Required | Purpose |
|---|---|---|---|
text | string | yes | Message shown alongside the image. |
image | string | yes | Image as a base64 data URL (data:image/png;base64,…). |
headline | string | yes | Short headline above the body, where supported. |
cta | string | yes | Call‑to‑action button label. |
entryPointDataJson | string (JSON) | yes | Serialized payload available to the recipient through entry point on join. Pass "{}" if you don’t need one. |
result callback | Action<int> | yes | 1 on success, 0 on cancel / failure. |
Screenshot texture settings
Section titled “Screenshot texture settings”This is the most common “share returns nothing” bug. For EncodeToPNG() to produce non‑empty bytes, the shareTexture asset must have:
- Read/Write Enabled: ON
- Compression: None
Rough size guidance: 512×386 or 1024×768 work fine. Avoid huge textures — the base64 payload is what gets POSTed to the host, and you pay the serialise/transfer cost.
Related
Section titled “Related”- Share vs. invite semantics, full platform surface list (templated updates, friends graph, real‑time presence): Web SDK social reference.