WebView returning blank post FB authorization - facebook

From my react native application, I am trying to authenticate against FB. Instead of directly using fbsdk, I was planning to use a wrapper around it.
I tried two wrappers.
https://github.com/xxsnakerxx/react-native-social-auth
https://github.com/magus/react-native-facebook-login
In both cases, I end up with a WebView which won't callback the app.
I have raised two issues
https://github.com/magus/react-native-facebook-login/issues/187
https://github.com/xxsnakerxx/react-native-social-auth/issues/6
XCode logs has below entries which I am not able to decipher
2016-12-09 06:13:29.757 XXXX[61829:8555589] -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2016-12-09 06:13:29.759 XXXX[61829:8555589] -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
and..
__nw_socket_service_writes_block_invoke sendmsg(fd 9, 31 bytes): socket has been closed
2016-12-09 06:13:36.670958 XXXX[61829:8574160] [] nw_endpoint_flow_protocol_error [15.1 157.240.7.20:443 cancelled socket-flow (null)] Socket protocol sent error: [32] Broken pipe
2016-12-09 06:13:36.671154 XXXX[61829:8574160] [] nw_endpoint_flow_protocol_disconnected [15.1 157.240.7.20:443 cancelled socket-flow (null)] Output protocol disconnected
And the WebView post all the authentication looks like

Eventually successful with react-native-social-auth. Missed a few configurations.

Related

Updating selectors after delegate addition failed with: Error Domain=NSCocoaError Domain Code=4099

Is anyone able to explain this error, and what might have caused it? I've been trying to create a messaging app using Firebase's Realtime Database in SwiftUI, but am unable to read from the database and have been getting this error.
Updating selectors after delegate addition failed with: Error
Domain=NSCocoaErrorDomain Code=4099 "The connection to service named
com.apple.commcenter.coretelephony.xpc was invalidated: failed at
lookup with error 3 - No such process."
I'm able to write to the database just fine but it doesn't seem to want to be read from, so I'm assuming it's because of whatever this error is. Thanks

Why is Swift Kitura Server Not Terminating Some Threads?

I am having a somewhat reproducible problem on a Swift server I'm running. This is a multi-threaded server, using Kitura. The basics are: After the server has been running for a period of time, download requests start needing retries from the client (usually three retries). The attempts from the client result in the server thread not terminating. On the server, the download problem shows up like this in the log:
[INFO] REQUEST /DownloadFile: ABOUT TO END ...
And then the request never terminates.
The relevant fragment code in my server looks like this:
// <snip>
Log.info(message: "REQUEST \(request.urlURL.path): ABOUT TO END ...")
do {
try self.response.end()
Log.info(message: "REQUEST \(request.urlURL.path): STATUS CODE: \(response.statusCode)")
} catch (let error) {
Log.error(message: "Failed on `end` in failWithError: \(error.localizedDescription); HTTP status code: \(response.statusCode)")
}
Log.info(message: "REQUEST \(request.urlURL.path): COMPLETED")
// <snip>
That is, the server clearly seems to hang on the call to end (a Kitura method). See also https://github.com/crspybits/SyncServerII/blob/master/Sources/Server/Setup/RequestHandler.swift#L105
Immediately before this issue came up last time, I observed the following in my server log:
[2017-07-12T15:31:23.302Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 5(0x5), ERROR: SSL_accept, code: 5, reason: DH lib
[2017-07-12T15:31:23.604Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
[2017-07-12T15:31:23.995Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
[2017-07-12T15:40:32.941Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
[2017-07-12T15:42:43.000Z] [VERBOSE] [HTTPServerRequest.swift:215 parsingCompleted()] HTTP request from=139.162.78.135; proto=https;
[INFO] REQUEST RECEIVED: /
[2017-07-12T16:32:38.479Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
I am not sure where this is coming from in the sense that I'm not sure if one of my client's is generating this. I do not explicitly make requests to my server with "/". (I do occasionally see requests made to my server from clients that are not mine-- it is possible this is one of these). Note that all except one of these log messages are coming from Kitura, not directly from my code. My log message is [INFO] REQUEST RECEIVED: /.
If I was a betting man, I'd say the above errors put my server into a state where afterwards, I see this download/retry behavior.
My only solution at this point is to restart the server. From which point the issue doesn't immediately happen.
Thoughts?
I'm not sure if this addresses the root problem, or if it's just a work-around, but it appears to be working. With the server as stated in the question, I had been using Kitura's built-in SSL support. I have now switched to using NGINX as a front-end, and no longer use Kitura's built-in SSL support. NGINX takes care of all the HTTPS/SSL details. Since doing this (about a month ago), and with the server running for all of that intervening time, I have not experience the not terminating issue reported in this question. See also https://github.com/crspybits/SyncServerII/issues/28

AppleMusicKit SDK / Sample Project - UserToken issue

I'm currently experimenting with the Adding-Content-to-Apple-Music code found here: https://developer.apple.com/musickit/
I'm using:
XCode 9 beta 2,
iOS 11 (iPhone 5s)
I have a developer token (which works when I query the Apple Music API searching songs etc...) but I now want to use this to exchange for a User Token so I can perform write actions against my Apple Music account.
The test app fires up and allows me to request authentication. From this I can see:
MPMedia Library - Authorized
SKCloudServicesController - Authorized
Capabilities:
Add to Cloud Music Library
Music Catalog Playback
My next obvious step is to use the developer token to gain the user token. However, as soon as I call the following:
cloudServiceController.requestUserToken(forDeveloperToken: developerToken, completionHandler: completionHandler)
i see the following error in the completionHandler - can anyone help?
2017-07-14 10:05:39.179300+0100 Adding-Content-to-Apple-Music[1326:172100] [MC] Reading from public effective user settings.
2017-07-14 10:05:40.635503+0100 Adding-Content-to-Apple-Music[1326:172299] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2017-07-14 10:05:40.636449+0100 Adding-Content-to-Apple-Music[1326:172100] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2017-07-14 10:05:40.800933+0100 Adding-Content-to-Apple-Music[1326:172297] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2017-07-14 10:05:40.801259+0100 Adding-Content-to-Apple-Music[1326:172299] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
An error occurred when requesting user token: The operation couldn’t be completed. (SKErrorDomain error 1.)
In Settings > iTunes & App Store on my device I am logged in with my Apple ID. Same goes for Apple Music too.
Update on this:
I also posted about this over on the Apple dev forums. It was an error on their side and now appears to be fixed. I can get a UserToken in both iOS 10 and 11 now.

Facebook iOS 10 login error :user not allowed to see application

I am new to iOS programming and I made an app that was able to connect to Facebook before without any problem. I've enabled keychain sharing and made the app public but last week I started seeing an error message:
2017-05-23 17:26:11.130 test[3231:77099] -canOpenURL: failed for URL:
"fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus
error -10814.)"
I've followed all the login steps, but no success.
Any help will be greatly appreciated.

request error Error Domain=SKErrorDomain Code=0 "Operation could not be completed. (SKErrorDomain error 0.)"

I am working on IN App purchase, storekit.
I am getting this error:
request error Error Domain=SKErrorDomain Code=0 "Operation could not be completed. (SKErrorDomain error 0.)"
What does this means?
Sometimes when you have bad internet connection, it returns that error because the app cannot communicate with the apple server. Just try to retry or if you have another internet connection source, try connecting there then do what you want again.
use device for testing not simulator
Restarting the device worked for me
This was happening on the Simulator and just closing the simulator and re-opening seemed to fixed it