Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visionOS support #471

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RevenueCat/Editor/RevenueCatPostInstall.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#if UNITY_EDITOR && UNITY_IOS
#if UNITY_EDITOR && (UNITY_IOS || UNITY_VISIONOS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to test this, but do we need to also check for vision os in line 16 below? https://docs.unity3d.com/ScriptReference/BuildTarget.VisionOS.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump to this @aboedo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it support Unity-VisionOS now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing with the new BuildTarget.VisionOS, this actually brakes with the current unity version we are using and it would be considered a breaking change. In any case, this script shouldn't really be needed in modern unity versions so we can merge without it.


using System.IO;
using UnityEngine;
Expand Down
2 changes: 1 addition & 1 deletion RevenueCat/Scripts/Purchases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void Start()
{
#if UNITY_ANDROID && !UNITY_EDITOR
_wrapper = new PurchasesWrapperAndroid();
#elif UNITY_IPHONE && !UNITY_EDITOR
#elif (UNITY_IOS || UNITY_VISIONOS) && !UNITY_EDITOR
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be the reason why before this PR, it would still compile, but no-op

_wrapper = new PurchasesWrapperiOS();
#else
_wrapper = new PurchasesWrapperNoop();
Expand Down
2 changes: 1 addition & 1 deletion RevenueCat/Scripts/PurchasesWrapperiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JetBrains.Annotations;
using UnityEngine;

#if UNITY_IOS
#if UNITY_IOS || UNITY_VISIONOS
public class PurchasesWrapperiOS : IPurchasesWrapper
{
[DllImport("__Internal")]
Expand Down