Skip to content

Commit af5fc12

Browse files
committed
Updates README and code
1 parent f6ed445 commit af5fc12

2 files changed

Lines changed: 13 additions & 28 deletions

File tree

AppleAuthSampleProject/Assets/AppleAuthSample/Editor/SignInWithApplePostprocessor.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,11 @@ public static void OnPostProcessBuild(BuildTarget target, string path)
2222
{
2323
#if UNITY_XCODE_EXTENSIONS_AVAILABLE
2424
var projectPath = PBXProject.GetPBXProjectPath(path);
25-
26-
#if UNITY_2019_3_OR_NEWER
27-
var project = new PBXProject();
28-
project.ReadFromString(System.IO.File.ReadAllText(projectPath));
29-
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, project.GetUnityMainTargetGuid());
30-
manager.AddSignInWithAppleWithCompatibility();
31-
manager.WriteToFile();
32-
#else
33-
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", PBXProject.GetUnityTargetName());
34-
manager.AddSignInWithAppleWithCompatibility();
35-
manager.WriteToFile();
36-
#endif
25+
var project = new PBXProject();
26+
project.ReadFromString(System.IO.File.ReadAllText(projectPath));
27+
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, project.GetUnityMainTargetGuid());
28+
manager.AddSignInWithAppleWithCompatibility();
29+
manager.WriteToFile();
3730
#endif
3831
}
3932
else if (target == BuildTarget.StandaloneOSX)

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ There are two options available to install this plugin. Either using the Unity P
105105

106106
#### Install via Git URL
107107

108-
Available starting from Unity 2018.3.
108+
Available starting from Unity 2020.3.
109109

110110
Just add this line to the `Packages/manifest.json` file of your Unity Project:
111111

@@ -144,7 +144,7 @@ This plugin **provides an extension method** for `ProjectCapabilityManager` ([do
144144

145145
Simply create a Post Processing build script ([more info](https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html)) that performs the call. If you already have a post process build script, it should be simple to add to your code.
146146

147-
The provided extension method is `AddSignInWithAppleWithCompatibility`. It accepts an optional argument for Unity 2019.3 to indicate the UnityFramework target Guid.
147+
The provided extension method is `AddSignInWithAppleWithCompatibility`.
148148

149149
Sample code:
150150
```csharp
@@ -159,19 +159,11 @@ public static class SignInWithApplePostprocessor
159159
return;
160160

161161
var projectPath = PBXProject.GetPBXProjectPath(path);
162-
163-
// Adds entitlement depending on the Unity version used
164-
#if UNITY_2019_3_OR_NEWER
165-
var project = new PBXProject();
166-
project.ReadFromString(System.IO.File.ReadAllText(projectPath));
167-
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, project.GetUnityMainTargetGuid());
168-
manager.AddSignInWithAppleWithCompatibility(project.GetUnityFrameworkTargetGuid());
169-
manager.WriteToFile();
170-
#else
171-
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", PBXProject.GetUnityTargetName());
172-
manager.AddSignInWithAppleWithCompatibility();
173-
manager.WriteToFile();
174-
#endif
162+
var project = new PBXProject();
163+
project.ReadFromString(System.IO.File.ReadAllText(projectPath));
164+
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, project.GetUnityMainTargetGuid());
165+
manager.AddSignInWithAppleWithCompatibility();
166+
manager.WriteToFile();
175167
}
176168
}
177169
```
@@ -214,7 +206,7 @@ There is also a [Getting Started site](https://developer.apple.com/sign-in-with-
214206

215207
The `AuthenticationServices.framework` should be added as Optional, to support previous iOS versions, avoiding crashes at startup.
216208

217-
The provided extension method uses reflection to integrate with the current tools Unity provides. It has been tested with Unity 2018.x and 2019.x. But if it fails on your particular Unity version, feel free to open a issue, specifying the Unity version.
209+
The provided extension method uses reflection to integrate with the current tools Unity provides. It has been tested with Unity 2020.x, 2021.x, 2022.x and 6000.0. But if it fails on your particular Unity version, feel free to open a issue, specifying the Unity version.
218210

219211
## Plugin setup (visionOS)
220212

0 commit comments

Comments
 (0)