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

tvOS target includes unsupported permissions #906

Closed
3 tasks done
RuudBurger opened this issue Nov 20, 2024 · 2 comments
Closed
3 tasks done

tvOS target includes unsupported permissions #906

RuudBurger opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@RuudBurger
Copy link

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

We have a single podfile for both iOS and tvOS. If we include permissions for notification on iOS, the RNPermissionHandlerNotifications.h is also included in the tvOS podspec.

Resulting in the following build error:
Screenshot 2024-11-20 at 11 48 05

Library version

4.1.5

Environment info

RN 0.75

Steps to reproduce

See podfile example below.
Can probably also replicate if you call

setup_permissions([
  'Notifications',
])

in a tvos target

Reproducible sample code

target 'App' do
  platform :ios, "15.5"

  setup_permissions([
    'Notifications',
  ])
  ...
end

target 'App-tvOS' do
  platform :tvos, "15.5"

  # this doesn't do anything, the above `Notifications` are still loaded
  setup_permissions([])
   ...
end
@RuudBurger RuudBurger added the bug Something isn't working label Nov 20, 2024
@zoontek
Copy link
Owner

zoontek commented Nov 20, 2024

# this doesn't do anything, the above `Notifications` are still loaded
setup_permissions([])

That's unfortunately expected given what it does under the hood (it updates the react-native-permissions podspec file).
I think the easiest way to fix this is just to wrap the unavailable APIs with #if TARGET_OS_IOS

@zoontek
Copy link
Owner

zoontek commented Nov 20, 2024

Done in 5.2.0 🚀
If you enjoyed the reactive support, think about sponsoring.

@zoontek zoontek closed this as completed Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants