Connection Errors on Initializing Spotify on iOS? - ios

I have been struggling with implementing the Spotify iOS SDK in a simple music player app I’m working on with the intention of learning more about the streaming platform’s API. My app’s features are storyboard-based and have simple functionality (i.e. connect/disconnect, pause/play, fast forward/rewind, fetch album artwork)
I modeled my authorization method off of the demo project SPTLoginSampleAppSwift, and have been trying to troubleshoot the errors I’m getting (I’ll paste them below).
After a few weeks of struggling with this API, I decided to run the demo project on my device and realized that it does not seem to function properly either. Does anyone know how I can fix these errors and successfully initiate Spotify functionality in my app? I’m quite frustrated and would really appreciate any advice. I'm including my repo below as well.
https://github.com/dglaser2/SpotifyPlayer
ERRORS:
Upon clicking connect:
-canOpenURL: failed for URL: "spotify:" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
Upon returning to app after authorization screen:
2021-01-07 16:59:16.775788-0500 SpotifyPlayerDavid[39554:3692500] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
2021-01-07 16:59:16.907970-0500 SpotifyPlayerDavid[39554:3688560] AppRemote: Connecting...
2021-01-07 16:59:16.921229-0500 SpotifyPlayerDavid[39554:3692500] [connection] nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]
2021-01-07 16:59:16.923633-0500 SpotifyPlayerDavid[39554:3692500] [connection] nw_socket_handle_socket_event [C2.2:1] Socket SO_ERROR [61: Connection refused]
2021-01-07 16:59:16.926122-0500 SpotifyPlayerDavid[39554:3691493] [connection] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
2021-01-07 16:59:16.926941-0500 SpotifyPlayerDavid[39554:3691493] TCP Conn 0x600002b6c0b0 Failed : error 0:61 [61]
2021-01-07 16:59:16.928526-0500 SpotifyPlayerDavid[39554:3688560] AppRemote: Failed connection attempt with error: Error Domain=com.spotify.app-remote.transport Code=-2000 "Stream error." UserInfo={NSLocalizedDescription=Stream error., NSUnderlyingError=0x600001228f00 {Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSLocalizedRecoverySuggestion=Reconnect the transport to the Spotify app., NSLocalizedFailureReason=A stream error has occured in the transport.

Related

onesignal in ios for react native

I am getting error while debugingios log
[connection] nw_socket_handle_socket_event [C94.1.2:1] Socket SO_ERROR [61: Connection refused]
[connection] nw_connection_get_connected_socket_block_invoke [C94] Client called nw_connection_get_connected_socket on unconnected nw_connection
TCP Conn 0x6000014c4500 Failed : error 0:61 [61]
I follow below link for setting onesignal in ios for react native but it's not woking.
however, it's working fine in android.
https://blog.logrocket.com/implement-push-notifications-react-native-onesignal/
https://documentation.onesignal.com/docs/react-native-sdk-setup
This is something else issue.
Please run on your real iPhone device

MultipeerConnectivity can't invite peer

I am trying to make an ios app and an osx app communicate between each other. Everything is good until the "invite peer" part. I got the errors bellow:
2022-07-18 17:45:10.066594+0800 iRemoteMac[42755:5561655] [connection] nw_socket_handle_socket_event [C6:1] Socket SO_ERROR [54: Connection reset by peer]
2022-07-18 17:45:10.067320+0800 iRemoteMac[42755:5558565] [MCNearbyServiceAdvertiser] PeerConnection connectedHandler (advertiser side) - error [Unable to connect].
2022-07-18 17:45:10.067366+0800 iRemoteMac[42755:5558565] [MCNearbyServiceAdvertiser] PeerConnection connectedHandler remoteServiceName is nil.
2022-07-18 17:45:20.050295+0800 iRemoteMac[42755:5562197] [MCNearbyServiceAdvertiser] Data from peer [My Dev,721645DB] received with error Connection closed.
Any ideas on what causes this error? I don't see where the remoteServiceName is.
thanks
Well, I didn't set MCNearbyServiceAdvertiserDelegate right, that's why I can't invite peer, but sometimes I still get this error though the connection can be set.

iOS 13.4 When app goto background from foreground network is getting disconnect

Steps to reproduce:
Create a new app and call any API to the server to get data
immediately take the app to background
network get disconnects
below is the log:
2020-03-26 17:21:00.894598+0530 TestApp[783:152843] Connection 2: received failure notification
2020-03-26 17:21:00.895805+0530 TestApp[783:152843] Connection 2: failed to connect 1:53, reason -1
2020-03-26 17:21:00.895895+0530 TestApp[783:152843] Connection 2: encountered error(1:53)
2020-03-26 17:21:00.901375+0530 TestApp[783:152843] Task <36B9553A-99F2-42FE-8650-A5E5155EFCFD>.<1> HTTP load failed, 0/0 bytes (error code: -1005 [1:53])
2020-03-26 17:21:00.901831+0530 TestApp[783:152843] Connection 1: received failure notification
2020-03-26 17:21:00.902078+0530 TestApp[783:152843] [] nw_flow_add_write_request [C1.1 40.85.185.46:443 failed channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] cannot accept write requests
2020-03-26 17:21:00.902200+0530 TestApp[783:152843] [] nw_write_request_report [C1] Send failed with error "Socket is not connected"
2020-03-26 17:21:00.905902+0530 TestApp[783:152870] Task <36B9553A-99F2-42FE-8650-A5E5155EFCFD>.<1> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x2824734e0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://api.server.account, NSErrorFailingURLKey=https://api.server.account, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=53, NSLocalizedDescription=The network connection was lost.}

React Native - iOS Real Device - Socket IO Web Sockets not Working

I have ran into an issue with socket events not hitting the server. I have an application that uses SocketIO. The application works great when I use iOS Simulator. As soon as I try to run my app on a real device socket events are not hitting the server. This is the case in both localhost and the instance located on AWS.
When I press a button that should send a socket event to the server I get nothing in the console in Xcode. The only thing I can see is an initial error that seems to happen continuously as soon as the application is built and launched.
2019-01-30 07:12:38.533860-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C512.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:38.536864-0800 Moder8[1033:191786] [] nw_socket_connect [C512.2:1] connectx(7, [srcif=0, srcaddr=<NULL>, dstaddr=::1.8097], SAE_ASSOCID_ANY, 0, NULL, 0, NULL, SAE_CONNID_ANY) failed: [61: Connection refused]
2019-01-30 07:12:38.537119-0800 Moder8[1033:191786] [] nw_socket_connect [C512.2:1] connectx failed (fd 7) [61: Connection refused]
2019-01-30 07:12:38.537176-0800 Moder8[1033:191786] [] nw_socket_connect connectx failed (fd 7) [61: Connection refused]
2019-01-30 07:12:38.538112-0800 Moder8[1033:190902] [] nw_connection_get_connected_socket [C512] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-30 07:12:38.538230-0800 Moder8[1033:190902] TCP Conn 0x282234840 Failed : error 0:61 [61]
2019-01-30 07:12:40.115642-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C513.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.115716-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C514.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.116498-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C513.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.116561-0800 Moder8[1033:191786] [] nw_socket_handle_socket_event [C514.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-30 07:12:40.116698-0800 Moder8[1033:190953] [] nw_connection_get_connected_socket [C513] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-30 07:12:40.116715-0800 Moder8[1033:190953] TCP Conn 0x28221d380 Failed : error 0:61 [61]
2019-01-30 07:12:40.116755-0800 Moder8[1033:190953] [] nw_connection_get_connected_socket [C514] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-30 07:12:40.116768-0800 Moder8[1033:190953] TCP Conn 0x28221d2c0 Failed : error 0:61 [61]
The reason I am skeptical as to whether this has anything to do with the problem is because I get this same error when I use the Simulator and the socket events reach the server just fine.
What I have done.
I have searched Google and have read many references to related stuff including:
React native socket io no events being emitted from client
Getting "socket.error: [Errno 61] Connection refused" python paramiko
https://medium.com/#hr.hseyin_80381/8-steps-to-get-rid-of-error-nw-connection-get-connected-socket-connection-has-no-connected-handler-1bf622ca2332
Can't connect to web socket react-native-meteor iOS
I almost feel like this is something ridiculously simple. I tried playing around with App Transport Security Settings but could not find anything that made a difference:
I figured out the problem. iOS requires you to use the Mac IP address when connecting to localhost. I forgot to add my socket url into the env config file so it was pointing at localhost which obviously will not work for the localhost server instance or the one on AWS.

API request failed on iOS 11.3/11.4 when called through VPN connection

VPN connection created successfully on iOS 10 and also API request executes successfully.
Also, VPN connection created successfully on iOS 11.3 and 11.4 but API request get failed and showing below error:
2018-06-06 15:50:42.366512+0800 myAPP[555:197322] [] nw_path_evaluator_request_nexus_and_stats NECP_CLIENT_ACTION_REQUEST_NEXUS_INSTANCE [65: No route to host]
2018-06-06 15:50:42.366629+0800 myAPP[555:197322] [] nw_endpoint_flow_setup_channel [33 192.168.0.1:8000 in_progress channel-flow (satisfied)] failed to request nexus instance: Error Domain=kNWErrorDomainPOSIX Code=65 "No route to host" UserInfo={NSDescription=No route to host}
2018-06-06 15:50:42.366734+0800 myAPP[555:197322] TIC TCP Conn Failed [18:0x1d0374580]: 1:65 Err(65)
2018-06-06 15:50:42.366808+0800 myAPP[555:197322] Task <2FDCE10C-8CB4-469D-AAE6-E9307A68069D>.<1> HTTP load failed (error code: -1004 [1:65])
2018-06-06 15:50:42.367049+0800 myAPP[555:197506] Task <2FDCE10C-8CB4-469D-AAE6-E9307A68069D>.<1> finished with error - code: -1004
Error-Optional(Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x1d0650f80
{Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=65, _kCFStreamErrorDomainKey=1}}
Thanks

Resources