Skip to content

Migration guides

Daniel Lupiañez Casares edited this page May 17, 2020 · 3 revisions

From v1.1.0 to v1.2.0

Mandatory changes

⚠️⚠️ Your PostProcessing build should be updated to ensure full compatibility on iOS

Unity 2019.3 onwards:

var project = new PBXProject();
project.ReadFromString(System.IO.File.ReadAllText(projectPath));
var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, project.GetUnityMainTargetGuid());
- manager.AddSignInWithApple();
+ manager.AddSignInWithAppleWithCompatibility(project.GetUnityFrameworkTargetGuid());
manager.WriteToFile();

Previous Unity versions:

var manager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", PBXProject.GetUnityTargetName());
- manager.AddSignInWithApple();
+ manager.AddSignInWithAppleWithCompatibility();
manager.WriteToFile();

Due to the introduction of macOS support, a namespace was changed.

- using AppleAuth.IOS.NativeMessages;
+ using AppleAuth.Native;

macOS support was added. This means if you build your game for macOS, a new MacOSAppleAuthManager.bundle will be included in your .app file, so you need to codesign it as well. More details about codesigning can be found in /docs/macOS_NOTES.md

From v1.0.0 to v1.1.0

Mandatory changes

Namespaces have been changed

- using AppleAuth.IOS;
- using AppleAuth.IOS.Enums;
- using AppleAuth.IOS.Extensions;
- using AppleAuth.IOS.Interfaces;
+ using AppleAuth;
+ using AppleAuth.Enums;
+ using AppleAuth.Extensions;
+ using AppleAuth.Interfaces;

There is no need anymore for an OnDemandMessageHandlerScheduler

- private OnDemandMessageHandlerScheduler scheduler;

Since it´s no longer required, the AppleAuthManager constructor only requires the deserializer

- this.appleAuthManager = new AppleAuthManager(deserializer, scheduler);
+ this.appleAuthManager = new AppleAuthManager(deserializer);

Updating for callback execution is now performed directly on the manager

- this.scheduler.Update();
+ this.appleAuthManager.Update();

Finally, there is no longer a need to instantiate a Manager to check if the platform is supported, the condition has been moved to a static method instead

- if (!this.appleAuthManager.IsCurrentPlatformSupported)
+ if (!AppleAuthManager.IsCurrentPlatformSupported)

So you can check before instantiating the manager, if the platform supports it

+ if (AppleAuthManager.IsCurrentPlatformSupported)
+ {
+     this.appleAuthManager = new AppleAuthManager(deserializer);
+ }

...

+ if (this.appleAuthManager != null)
+ {
+     this.appleAuthManager.Update();
+ }

Recommended changes

Main QuickLogn and LoginWithAppleId methods are obsolete. Now both require a struct with data about the login intent.

- this.QuickLogin(successCallback, errorCallback);
+ this.QuickLogin(new AppleAuthQuickLoginArgs(), successCallback, errorCallback);
- this.LoginWithAppleId(options, successCallback, errorCallback);
+ this.LoginWithAppleId(new AppleAuthLoginArgs(options), successCallback, errorCallback);