Skip to content

Commit

Permalink
Merge pull request #182 from lupidan/canary
Browse files Browse the repository at this point in the history
v1.4.3 Release
  • Loading branch information
lupidan authored Sep 30, 2023
2 parents e39981b + f2c6630 commit d4296db
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 26 deletions.
2 changes: 1 addition & 1 deletion AppleAuth/AppleAuthManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AppleAuthManager : IAppleAuthManager
{
static AppleAuthManager()
{
const string versionMessage = "Using Sign in with Apple Unity Plugin - v1.4.2";
const string versionMessage = "Using Sign in with Apple Unity Plugin - v1.4.3";
#if APPLE_AUTH_MANAGER_NATIVE_IMPLEMENTATION_AVAILABLE
PInvoke.AppleAuth_LogMessage(versionMessage);
#else
Expand Down
20 changes: 14 additions & 6 deletions AppleAuth/Editor/ProjectCapabilityManagerExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class ProjectCapabilityManagerExtension
private const string DefaultAccessLevel = "Default";
private const string AuthenticationServicesFramework = "AuthenticationServices.framework";
private const BindingFlags NonPublicInstanceBinding = BindingFlags.NonPublic | BindingFlags.Instance;
private const BindingFlags PublicInstanceBinding = BindingFlags.Public | BindingFlags.Instance;

/// <summary>
/// Extension method for ProjectCapabilityManager to add the Sign In With Apple capability in compatibility mode.
Expand All @@ -23,17 +24,15 @@ public static class ProjectCapabilityManagerExtension
public static void AddSignInWithAppleWithCompatibility(this ProjectCapabilityManager manager, string unityFrameworkTargetGuid = null)
{
var managerType = typeof(ProjectCapabilityManager);
var capabilityTypeType = typeof(PBXCapabilityType);

var projectField = managerType.GetField("project", NonPublicInstanceBinding);
var targetGuidField = managerType.GetField("m_TargetGuid", NonPublicInstanceBinding);
var entitlementFilePathField = managerType.GetField("m_EntitlementFilePath", NonPublicInstanceBinding);
var getOrCreateEntitlementDocMethod = managerType.GetMethod("GetOrCreateEntitlementDoc", NonPublicInstanceBinding);
var constructorInfo = capabilityTypeType.GetConstructor(
NonPublicInstanceBinding,
null,
new[] {typeof(string), typeof(bool), typeof(string), typeof(bool)},
null);

// in old unity versions PBXCapabilityType had internal ctor; that was changed to public afterwards - try both
var constructorInfo = GetPBXCapabilityTypeConstructor(PublicInstanceBinding) ??
GetPBXCapabilityTypeConstructor(NonPublicInstanceBinding);

if (projectField == null || targetGuidField == null || entitlementFilePathField == null ||
getOrCreateEntitlementDocMethod == null || constructorInfo == null)
Expand Down Expand Up @@ -64,6 +63,15 @@ public static void AddSignInWithAppleWithCompatibility(this ProjectCapabilityMan
project.AddCapability(mainTargetGuid, capabilityType, entitlementFilePath, false);
}
}

private static ConstructorInfo GetPBXCapabilityTypeConstructor(BindingFlags flags)
{
return typeof(PBXCapabilityType).GetConstructor(
flags,
null,
new[] {typeof(string), typeof(bool), typeof(string), typeof(bool)},
null);
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions AppleAuth/Native/AppleError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ public void OnAfterDeserialize()

SerializationTools.FixSerializationForArray(ref this._localizedRecoveryOptions);
}

public override string ToString()
{
return $"Domain={_domain} Code={_code} Description={_localizedDescription}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>20F71</string>
<string>22G120</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.2</string>
<string>1.4.3</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand All @@ -27,21 +27,21 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12E507</string>
<string></string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>11.3</string>
<string>14.0</string>
<key>DTSDKBuild</key>
<string>20E214</string>
<string>23A334</string>
<key>DTSDKName</key>
<string>macosx11.3</string>
<string>macosx14.0</string>
<key>DTXcode</key>
<string>1251</string>
<string>1500</string>
<key>DTXcodeBuild</key>
<string>12E507</string>
<string>15A240d</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<string>10.13</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020 Daniel Lupiañez Casares. All rights reserved.</string>
</dict>
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion AppleAuth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.lupidan.apple-signin-unity-src",
"displayName": "Sign in with Apple [Local Source]",
"version": "1.4.2",
"version": "1.4.3",
"unity": "2018.3",
"description": "[Local Source]\nProvides a Unity bridge to use the native Sign In With Apple method on iOS/iPadOS/tvOS/macOS devices",
"author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.4.2
bundleVersion: 1.4.3
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.4.3] - 2023-09-30
### Changed
- Updates `AddSignInWithAppleWithCompatibility` to support new public constructor for `PBXCapabilityType` introduced in Unity 2022.3.10
- Increases minimum target for the macOS bundle to 10.13

### Added
- Add `ToString` override to `AppleError`

## [1.4.2] - 2020-07-17
### Changed
- Handles empty `NSPersonNameComponents` sent by Apple when not requesting a name, to be `nil` natively.
Expand Down Expand Up @@ -101,7 +109,8 @@
- Added support to listen to Revoked Credentials notifications
- Solved possible crashes that could happen when trying to execute a callback in the Native Message Handler, if the callback was to throw an exception, the application would crash.

[Unreleased]: https://github.com/lupidan/apple-signin-unity/compare/v1.4.2...HEAD
[Unreleased]: https://github.com/lupidan/apple-signin-unity/compare/v1.4.3...HEAD
[1.4.3]: https://github.com/lupidan/apple-signin-unity/compare/v1.4.2...v1.4.3
[1.4.2]: https://github.com/lupidan/apple-signin-unity/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/lupidan/apple-signin-unity/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/lupidan/apple-signin-unity/compare/v1.3.0...v1.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = MacOSAppleAuthManager/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.4.2;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.4.3;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.lupidan.MacOSAppleAuthManager;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -311,8 +311,8 @@
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = MacOSAppleAuthManager/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.4.2;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.4.3;
PRODUCT_BUNDLE_IDENTIFIER = com.lupidan.MacOSAppleAuthManager;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Sign in with Apple in order to get approved for the App Store, making it **manda

## Installation

> Current stable version is v1.4.2
> Current stable version is v1.4.3
There are two options available to install this plugin. Either using the Unity Package Manager, or the traditional `.unitypackage` file.

Expand All @@ -109,7 +109,7 @@ Just add this line to the `Packages/manifest.json` file of your Unity Project:

```json
"dependencies": {
"com.lupidan.apple-signin-unity": "https://github.com/lupidan/apple-signin-unity.git#v1.4.2",
"com.lupidan.apple-signin-unity": "https://github.com/lupidan/apple-signin-unity.git#v1.4.3",
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.lupidan.apple-signin-unity",
"displayName": "Sign in with Apple",
"version": "1.4.2",
"version": "1.4.3",
"unity": "2018.3",
"description": "Provides a Unity bridge to use the native Sign In With Apple method on iOS/iPadOS/tvOS/macOS devices",
"author": {
Expand Down

0 comments on commit d4296db

Please sign in to comment.