microsoft / react-native-macos

A framework for building native macOS apps with React.
https://microsoft.github.io/react-native-windows/
MIT License
3.37k stars 129 forks source link

[QUESTION] Looking for any guidance as to how one might connect to a macOS XPC service on the same machine #2134

Open michelcrypt4d4mus opened 1 month ago

michelcrypt4d4mus commented 1 month ago

Summary

Apologies for calling this a "feature request" i just wasn't sure how else to ask about this...

I've been poking around the internet trying to figure out how i might get my RNM app connect to an XPC service offered by another part of my app bundle and come up pretty empty. All I've really managed to gather is that React Native (maybe) has the ability to connect to the Bluetooth XPC service offered by iOS. I'm assuming that somewhere under the hood RNM also does this but grepping the repo for "XPC" yielded no results.

i don't need to connect to bluetooth - i want to connect to another service i will write - but i'm just not sure how to approach this problem so i figured it was worth asking here. In more concrete terms my questions are:

  1. Would I have to do something like this through fully customized components or is there some part of RN or RNM that i haven't found out about yet that would simplify this? i've already managed to build some customized components in Swift and successfully integrate them to my RNM app so this isn't overwhelmingly intimidating though i'm not sure if exporting Swift functions that aren't react components works any differently.

  2. Anyone have any other guidance or links that would help me understand how RN utilizes XPC for bluetooth or anything else? despite a bunch of issues in the official RN repo mentioning XPC the string "XPC" doesn't appear anywhere in the actual RN codebase.

Motivation

RNM is theoretically a great tool for building a front end configuration panel to a multi-part macOS app or service (at least that's what i've done with it and despite some frustrations it worked great) but IPC on macOS is supposed to be done with XPC services and it's unclear how to even approach doing that kind of thing.

Basic Example

No response

Open Questions

No response