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

APIs that are not available to extensions should be marked with NS_EXTENSION_UNAVAILABLE #10821

Closed
shrutic opened this issue Nov 8, 2016 · 7 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@shrutic
Copy link
Contributor

shrutic commented Nov 8, 2016

Description

We want to build an iMessage extension (available only in iOS 10+ and Xcode 8+) using React native. Cocoapods made some fixes in their 1.1.1 version that is causing React native pod integration to fail in iOS extensions. Here is the issue logged against Cocoapods.

In summary, Cocoapods made fixes to correctly check that the pods have marked "its APIs that don't work for extensions as NS_EXTENSION_UNAVAILABLE". This change has disabled us from using the React native pod in iOS extensions.

The errors are

sharedApplication" is unavailable on iOS(App Extension) - Use view controller based solutions when appropriate

Reproduction

I dont have sample project and can work on getting one if necessary

Additional Information

  • React Native version:0.34
  • Platform: iOS
  • Operating System: MacOS
  • Image of errors
    image
@shergin shergin added the Platform: iOS iOS applications. label Mar 16, 2017
@hramos
Copy link
Contributor

hramos commented May 31, 2017

Thanks for filing the issue. This seems like something that should be fixed. Do you have a list of the particular APIs that need to be marked in this manner?

Here's the summary from the linked issue, for context:

It looks like React Native hasn't marked its APIs that don't work for extensions as NS_EXTENSION_UNAVAILABLE, etc. You should file an issue with React Native.

Calling methods that access APIs that aren't available in extensions would likely crash, and I'm unsure how this compiled before. This apparent unintended side-effect of CocoaPods 1.1.0 does seem unfortunate in your circumstance, but in general this is now behaving as expected: APIs that could crash when accessed from extensions should fail to build unless they've been marked with NS_EXTENSION_UNAVAILABLE when built for use with an extension.

@hramos hramos changed the title Using cocoapods 1.1.1 to install react native in iMessage extension on ios causes compile errors APIs that are not available to extensions should be marked with NS_EXTENSION_UNAVAILABLE May 31, 2017
@hramos
Copy link
Contributor

hramos commented Aug 4, 2017

Closing this issue as we haven't heard back from the author.

@hramos hramos closed this as completed Aug 4, 2017
@shrutic
Copy link
Contributor Author

shrutic commented Aug 4, 2017

I have created multiple PRs for this purpose and one of them is pending.. Some got checked in and one of them is still pending. Let me go and see if I can find it. But I have been working around this by creating my own fork of react-native and pointing to it from my project

@hramos
Copy link
Contributor

hramos commented Aug 4, 2017

Thanks for letting us know! I didn't see them here. Can you update your PRs to mention this issue? That way they'll automatically close this issue when they're merged. It also helps others see that a particular issue may already have a proposed fix in the pipeline.

@hramos hramos reopened this Aug 4, 2017
@shrutic
Copy link
Contributor Author

shrutic commented Aug 4, 2017

Accepted PRs:
#13328
#13227

Pending PR:
Still need some time to find it as I think I created it from a different profile

@shrutic
Copy link
Contributor Author

shrutic commented Aug 4, 2017

#14263 . Turns out this was closed due to some concern about wrapping APIs this fashion. It would be awesome if you could pursue an alternative way of fixing this issue so that I can upgrade to the facebook's react-native version, instead of using my forked version

Thanks for follow up

@pull-bot
Copy link

pull-bot commented Oct 9, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Oct 9, 2017
@hramos hramos closed this as completed Oct 9, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Oct 9, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants