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

No type or protocol named UIApplicationOpenURLOptionsKey #1941

Open
ElangoPrince opened this issue Sep 28, 2023 · 3 comments
Open

No type or protocol named UIApplicationOpenURLOptionsKey #1941

ElangoPrince opened this issue Sep 28, 2023 · 3 comments
Labels
bug Something isn't working Needs: Triage 🔍

Comments

@ElangoPrince
Copy link

ElangoPrince commented Sep 28, 2023

Environment

react-native -v: 0.72.5
npm ls react-native-macos: react-native-macos@0.72.0 
node -v: v19.5.0
npm -v: 6.14.18
yarn --version: NR
xcodebuild -version: Xcode 14.2, Build version 14C18

Steps to reproduce the bug

react-native run-macos

Expected Behavior

No response

Actual Behavior

AppDelegate.mm
#import <React/RCTLinkingManager.h>

(BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:app openURL:url options:options];
}
270584553-4bda69a7-4172-4faf-85c6-5ee02ec4bb84 270583824-1c602c89-a470-4f18-a409-0323d1d9aec8

Reproducible Demo

No response

Additional context

No response

Tasks

No tasks being tracked yet.
@ElangoPrince ElangoPrince added the bug Something isn't working label Sep 28, 2023
@ElangoPrince
Copy link
Author

@Team can you anyone ans this? How to manage Linking in macOS application.

@amgleitman
Copy link
Member

Hi @ElangoPrince,

The method -application:openURL:options: is part of UIKit, so it's an iOS-only thing. The easiest way to resolve this is to surround this implementation in an #if !TARGET_OS_OSX block like we do in RNTester:

#if !TARGET_OS_OSX // [macOS]
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
return [RCTLinkingManager application:app openURL:url options:options];
}
#endif // [macOS]

@Saadnajmi
Copy link
Collaborator

Hi, revisiting this issue, Is there a problem with the template app where this iOS only method is showing up? We can remove it from the latest templates if that fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

3 participants