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

feat: add visionOS support #2644

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

okwasniewski
Copy link
Contributor

@okwasniewski okwasniewski commented Dec 19, 2023

This PR adds visionOS support.

I've refactored some parts of the code to take the currently presented scene by wrapping built-in utility RCTKeyWindow() to work in async scenarios.

Testing

  1. npx @callstack/react-native-visionos init App
  2. Add react-native-iap
  3. Check out if it works

Demo

CleanShot.2024-03-05.at.09.53.42.mp4


@interface RCT_EXTERN_MODULE (RNIapIosSk2, NSObject)

RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(isAvailable){
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"15.0")) {
if (@available(iOS 15.0, *)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've refactored this to use @available the SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO was returning "1.0" for visionOS and @available is universal.

Source: https://roadfiresoftware.com/2014/01/the-right-way-to-check-the-ios-version-in-an-app/

@okwasniewski
Copy link
Contributor Author

Build is failing because CI needs a newer Xcode version

@matthargett
Copy link

@hyochan can @okwasniewski get some permissions to help work out the CI issue, so this PR can be made to pass CI? His similar visionOS work has been merged in gesture-handler, reanimated, screens, and numerous other projects. It would be great to get IAP support into a release of our react-native-visionos apps soon without the need for local patches :D

@okwasniewski okwasniewski force-pushed the feat/visionOS branch 3 times, most recently from 4cffadb to e728c7e Compare March 4, 2024 14:20
@okwasniewski okwasniewski marked this pull request as ready for review March 5, 2024 08:55
@okwasniewski
Copy link
Contributor Author

Hey @hyochan, I've fixed the CI and the PR is now ready for review. Let me know if I can help you in any way to get this merged

ios/RNIapIosSk2.swift Outdated Show resolved Hide resolved
.github/workflows/ci-example-ios.yml Show resolved Hide resolved
@matthargett
Copy link

@TheRogue76 was there anything else needed for this to be merged? I'm excited to remove our local patch-package and let other RNV apps start to monetize :)

@TheRogue76
Copy link

@TheRogue76 was there anything else needed for this to be merged? I'm excited to remove our local patch-package and let other RNV apps start to monetize :)

I am not a maintainer of RN IAP, simply an open-source contributor who used this repo at one point and had it marked as watched. I just double-checked the PR. I do not have access to the repo to merge or block the PRs. As far as I see, the PR is perfectly fine.

@hyochan hyochan added the 🎯 feature New feature label Jun 11, 2024
@hyochan
Copy link
Member

hyochan commented Jun 11, 2024

@TheRogue76 was there anything else needed for this to be merged? I'm excited to remove our local patch-package and let other RNV apps start to monetize :)

I am not a maintainer of RN IAP, simply an open-source contributor who used this repo at one point and had it marked as watched. I just double-checked the PR. I do not have access to the repo to merge or block the PRs. As far as I see, the PR is perfectly fine.

Could you kindly accept this review when you think this PR is good?

@TheRogue76
Copy link

@TheRogue76 was there anything else needed for this to be merged? I'm excited to remove our local patch-package and let other RNV apps start to monetize :)

I am not a maintainer of RN IAP, simply an open-source contributor who used this repo at one point and had it marked as watched. I just double-checked the PR. I do not have access to the repo to merge or block the PRs. As far as I see, the PR is perfectly fine.

Could you kindly accept this review when you think this PR is good?

Approved on my side. As far as i can see, it looks good to me. Not sure if the comment was towards me or not but i figured a double check would not hurt.🙏

@hyochan hyochan added the 📱 iOS Related to iOS label Jun 12, 2024
@hyochan
Copy link
Member

hyochan commented Jun 12, 2024

Approved on my side. As far as i can see, it looks good to me. Not sure if the comment was towards me or not but i figured a double check would not hurt.🙏

Thank you for taking an interest and reviewing this PR. Based on your involvement, I kindly request that you complete the review for this PR!

@hyochan hyochan merged commit aff3726 into dooboolab-community:main Jun 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature New feature 📱 iOS Related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants