-
Notifications
You must be signed in to change notification settings - Fork 155
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
Does react-native-udp need changes for new iOS 14 Local Network Privacy? #139
Comments
Also see this issue thread on the CocoaAsyncSocket repository which react-native-udp uses under the hood. |
@thibmaek, thanks for the feedback! I don't know if this might be a CocoaAsyncSocket issue or react-native-udp must also update the iOS code. Sadly, I cannot test any iOS 14 device at the moment. CocoaAsyncSocket is written in Objective-C and it is starting to show multiple deprecation warnings when compiling. I might have to look for another library for the long run. This problem might be fixed by switching to another iOS socket library. If you find any more relevant info, please post on this issue! |
Hi, I'll just leave this here, as this contains extremely useful information by an Apple employee concerning the new "Local Network Privacy" behavior: |
Any update on this? |
somebody is using this package for ios? is there anything we have to consider? |
@rt012 As far as I know, Apple performed some fixes by now, which makes sure that the local network permission alert is properly triggered when using UDP. Apart from that, there's nothing special to take care of. |
hi, author! |
@Rapsssito Can you answer my question? |
Hi, Were you able to make it work it before on different version?
Sent from Yahoo Mail for iPhone
On Saturday, May 18, 2024, 7:52 PM, ly678910 ***@***.***> wrote:
@Rapsssito Can you answer my question?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
I do not try other versions,only use 4.1.7 the latest version |
Did it work at anytime or this is your first time trying it? I am just comparing it to my use case and maybe I can help and tell you where to look.
Sent from Yahoo Mail for iPhone
On Saturday, May 18, 2024, 11:36 PM, ly678910 ***@***.***> wrote:
Hi, Were you able to make it work it before on different version?
I do not try other versions,only use 4.1.7 the latest version
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
@gibo77 I first try to use it |
I am not sure what version I have. Last year I was able to make it work in my use case. But I have to employ Asynchronous functions as UDP is such. See discussion below. What is your client and server? Mine react native UDP is the client.
Understanding Async/Await in Node.js | Postman Blog
|
|
|
| | |
|
|
|
| |
Understanding Async/Await in Node.js | Postman Blog
By Lillian Nose
Learn what async/await is, how it differs from other syntaxes, and how to use it in your own code.
| |
|
|
Sent from Yahoo Mail for iPhone
On Sunday, May 19, 2024, 2:55 AM, ly678910 ***@***.***> wrote:
@gibo77 I first try to use it
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
My ios14+ problem is solved,for ios 14+,first "info.list" add the "NSLocalNetworkUsageDescription " permission. This code "socket.setBroadcast(true)" must be executed delay 500ms later. This allows you to send and receive udp messages. The code is organized as follows: import dgram from 'react-native-udp' const socket = dgram.createSocket('udp4') }) socket.on('message', function(msg, rinfo) { |
Destroy pages Remember to turn off the broadcast,excute code "socket.setBroadcast(false);" |
for android, Don't use the code "udpSocket.setBroadcast(true);" |
With iOS 14 Apple introduced the new Local Network Privacy feature which prompts users first that an application wants to interface with devices on the local network.
For now, we are not seeing any prompt with react-native-udp although we're interfacing with the local network by performing device discovery, sending a datagram to the broadcast address of a router (255.255.255.255).
It seems weird that when we interface with UDP at this network level we would not see the prompt. Is this something that needs to be added to react-native-udp?
The text was updated successfully, but these errors were encountered: