diff --git a/.github/latest.md b/.github/latest.md index 748f84b..7ab5771 100644 --- a/.github/latest.md +++ b/.github/latest.md @@ -2,5 +2,5 @@ This release adds support for handling account linking and asset unlock events c ## Changelog -- scripting define symbol `RPM_DISABLE_WEBVIEW_PERMISSIONS` can now be used to disable Android permissions override @harrisonhough in [#26](https://github.com/readyplayerme/rpm-unity-sdk-webview/pull/26) - +- fixed a flaw in the logic for disabling android build processor +- an error causing android builds to fail \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index db08e77..03d7244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [2.1.0] - 2024.04.01 +## [2.1.1] - 2024.09.01 + +### Fixed +- fixed a flaw in the logic for disabling android build processor +- an error causing android builds to fail + +## [2.1.0] - 2024.08.01 ### Added - scripting define symbol `RPM_DISABLE_WEBVIEW_PERMISSIONS` can now be used to disable Android permissions override @harrisonhough in [#26](https://github.com/readyplayerme/rpm-unity-sdk-webview/pull/26) diff --git a/Editor/AndroidBuildProcessor.cs b/Editor/AndroidBuildProcessor.cs index 85f635c..9c46461 100644 --- a/Editor/AndroidBuildProcessor.cs +++ b/Editor/AndroidBuildProcessor.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && !RPM_DISABLE_WEBVIEW_PERMISSIONS +#if UNITY_ANDROID && !RPM_DISABLE_WEBVIEW_PERMISSIONS using System.IO; using System.Xml; using UnityEditor; @@ -6,7 +6,7 @@ using UnityEditor.Android; using UnityEditor.Callbacks; -namespace ReadyPlayerMe.WebView +namespace ReadyPlayerMe.WebView.Editor { /// /// Receives a callback after the Android Gradle project is generated, diff --git a/Editor/IOSBuildProcessor.cs b/Editor/IOSBuildProcessor.cs new file mode 100644 index 0000000..c0f6923 --- /dev/null +++ b/Editor/IOSBuildProcessor.cs @@ -0,0 +1,23 @@ +#if UNITY_IOS +using System.IO; +using UnityEditor; +using UnityEngine; +using UnityEditor.Callbacks; + +namespace ReadyPlayerMe.WebView.Editor +{ + public class IOSBuildProcessor + { + [PostProcessBuildAttribute(100)] + public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) + { + if (BuildTarget.iOS != target) return; + var projectPath = $"{pathToBuiltProject}/Unity-iPhone.xcodeproj/project.pbxproj"; + PBXProject proj = new PBXProject(); + proj.ReadFromString(File.ReadAllText(projectPath)); + proj.AddFrameworkToProject(proj.TargetGuidByName("Unity-iPhone"), "WebKit.framework", false); + File.WriteAllText(projectPath, proj.WriteToString()); + } + } +} +#endif diff --git a/Editor/IOSBuildProcessor.cs.meta b/Editor/IOSBuildProcessor.cs.meta new file mode 100644 index 0000000..2b3ffb3 --- /dev/null +++ b/Editor/IOSBuildProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7815194cc95d1184b87a3c5afa9863eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ReadyPlayerMe.WebView.Editor.asmdef b/Editor/ReadyPlayerMe.WebView.Editor.asmdef new file mode 100644 index 0000000..bfd30a1 --- /dev/null +++ b/Editor/ReadyPlayerMe.WebView.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "ReadyPlayerMe.WebView.Editor", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta b/Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta new file mode 100644 index 0000000..199bfa7 --- /dev/null +++ b/Editor/ReadyPlayerMe.WebView.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd6e68b4e29a75641843da0d43ce8a9e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/WebViewEditor.cs b/Editor/WebViewEditor.cs index 339153e..0cba95d 100644 --- a/Editor/WebViewEditor.cs +++ b/Editor/WebViewEditor.cs @@ -1,10 +1,9 @@ -#if UNITY_EDITOR using UnityEditor; using UnityEngine; -namespace ReadyPlayerMe.WebView +namespace ReadyPlayerMe.WebView.Editor { - public class WebViewEditor : Editor + public class WebViewEditor : UnityEditor.Editor { private const string WEB_VIEW_CANVAS_FILE_NAME = "WebView Canvas"; @@ -22,4 +21,3 @@ private static void LoadWebViewCanvas() } } } -#endif diff --git a/package.json b/package.json index 83fad81..a482cb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.readyplayerme.webview", - "version": "2.1.0", + "version": "2.1.1", "displayName": "Ready Player Me WebView", "description": "Ready Player Me WebView helps you display an in-engine browser that helps you load RPM website where you can create avatars and receive avatar URL at the end of the process.\nWebView is mobile only and works in Android and IOS builds.", "category": "tool",