Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.1.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jan 17, 2024
2 parents 0bfdb57 + 3da0f24 commit f400bda
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

## Changelog

- fixed an issue causing errors when targeting iOS
- fix for deprecated PBXProject function
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.2 - 2024.11.01
## [2.1.3] - 2024.17.01

### Fixed
- fix for deprecated PBXProject function

## [2.1.2] - 2024.11.01

### Fixed
- an issue causing errors when targeting iOS
Expand Down
28 changes: 18 additions & 10 deletions Editor/IOSBuildProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
#if UNITY_IOS
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.iOS.Xcode;

namespace ReadyPlayerMe.WebView.Editor
{
public class IOSBuildProcessor
public class IOSBuildProcessor : IPostprocessBuildWithReport
{
[PostProcessBuildAttribute(100)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
public int callbackOrder => 0;

public void OnPostprocessBuild(BuildReport report)
{
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());
if (report.summary.platform != BuildTarget.iOS) return;

var projectPath = $"{report.summary.outputPath}/Unity-iPhone.xcodeproj/project.pbxproj";

var pbxProject = new PBXProject();
pbxProject.ReadFromFile(projectPath);

// Main
var targetGuid = pbxProject.GetUnityMainTargetGuid();
pbxProject.AddFrameworkToProject(targetGuid, "WebKit.framework", false);

pbxProject.WriteToFile(projectPath);
}
}
}
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.webview",
"version": "2.1.2",
"version": "2.1.3",
"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",
Expand Down

0 comments on commit f400bda

Please sign in to comment.