Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update web message json handling #311

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

## Changelog

## Updated
- Reworked shader overrides to support mapping of other property types [#306](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/306)

## Fixed
- Fixed an issue caused by missing bones on avatar template prefabs [#310](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/310/)
- Fixed an issue causing json parsing to fail on iFrame events [#311](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/311/)
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [7.1.1] - 2024.07.25

## Fixed
- Fixed an issue causing json parsing to fail on iFrame events [#311](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/311/)

## [7.1.0] - 2024.07.16

## Updated
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Scripts/Data/ApplicationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ReadyPlayerMe.Core
{
public static class ApplicationData
{
public const string SDK_VERSION = "v7.1.0";
public const string SDK_VERSION = "v7.1.1";
private const string TAG = "ApplicationData";
private const string DEFAULT_RENDER_PIPELINE = "Built-In Render Pipeline";
private static readonly AppData Data;
Expand Down
2 changes: 1 addition & 1 deletion Runtime/WebView/Data/WebMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public struct WebMessage
public string type;
public string source;
public string eventName;
public Dictionary<string, string> data;
public Dictionary<string, object> data;
}
}
16 changes: 8 additions & 8 deletions Runtime/WebView/WebMessageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ public static class WebMessageHelper

public static string GetAvatarUrl(this WebMessage webMessage)
{
webMessage.data.TryGetValue(DATA_URL_FIELD_NAME, out var avatarUrl);
return avatarUrl ?? string.Empty;
webMessage.data.TryGetValue(DATA_URL_FIELD_NAME, out var avatarUrlObject);
return (string) avatarUrlObject ?? string.Empty;
}

public static string GetUserId(this WebMessage webMessage)
{
webMessage.data.TryGetValue(ID_KEY, out var userId);
return userId ?? string.Empty;
webMessage.data.TryGetValue(ID_KEY, out var userIdObject);
return (string) userIdObject ?? string.Empty;
}

public static AssetRecord GetAssetRecord(this WebMessage webMessage)
{
webMessage.data.TryGetValue(ASSET_ID_KEY, out var assetId);
webMessage.data.TryGetValue(USER_ID_KEY, out var userId);
webMessage.data.TryGetValue(ASSET_ID_KEY, out var assetIdObject);
webMessage.data.TryGetValue(USER_ID_KEY, out var userIdObject);
var assetRecord = new AssetRecord();
assetRecord.AssetId = assetId;
assetRecord.UserId = userId;
assetRecord.AssetId = (string) assetIdObject ?? string.Empty;
assetRecord.UserId = (string) userIdObject ?? string.Empty;
return assetRecord;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.readyplayerme.core",
"version": "7.1.0",
"version": "7.1.1",
"displayName": "Ready Player Me Core",
"description": "This Module contains all the core functionality required for using Ready Player Me avatars in Unity, including features such as: \n - Module management and automatic package setup logic\n - Avatar loading from .glb files \n - Avatar creation \n - Avatar and 2D render requests \n - Optional Analytics\n - Custom editor windows\n - Sample scenes and assets",
"unity": "2020.3",
Expand Down