Closed dabor238 closed 7 years ago
Anything related to #12?
I don't think that is the same issue, because: 1) the server is HTTPS 2) the hub has no security, you can access it here: https://www.multidoctores.com/signalr/hubs
Do I have to configure the hub in any specific way to test the library. Do you have an example of a server side hub that actually works with this library?
It tries to negotiate with
[16:41:33 GMT-0500 (ECT)] SignalR: Negotiating with 'https://www.multidoctores.com/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D'.
that brings a valid token. but then it gives us the SignalR error: undefined.
Testing now. Hold on.
@dabor238 I get: "An SSL error has occurred and a secure connection to the server cannot be made." Sry. There is a bug in the lib that hides the actual error.
But do this: Start react-native with chrome dev tools. Go to sources tab and press cmd + O (mac) ctrl + O (windows) and search for the file ajax.js and open it. should look like this:
export default function(options, data) {
var request = new XMLHttpRequest();
request.onreadystatechange = (e) => {
if (request.readyState !== 4) {
return;
}
if (request.status === 200 && !request._hasError) {
options.success && options.success(JSON.parse(request.responseText));
} else {
options.error && options.error(request);
}
};
request.open(options.type, options.url);
request.setRequestHeader('content-type', options.contentType);
request.send(options.data.data && `data=${options.data.data}`);
return {
abort: function(reason) {
return request.abort(reason);
}
};
}
Place a breakpoint at options.error and then inspect your error.
Now for the error itself I do not know what's wrong exactly. You have any idea?
I now connected successfully to your server by disabling NSAppTransportSecurity
..Hmm don't really know why it won't connect without it.
added
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
to Info.plist.
_response: An SSL error has occurred and a secure connection to the server cannot be made.
No idea why this happened, we are using this hub on WEB, Native Android and Native Ios, and it works fine.
I added at the end and still doesnt work.
Hmm.. might be incorrectly formated.
This i my entire Info.plist in XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
Try opening yours in xcode and see if it can open it.
olofd: the boy wonder, the kid, the miracle man. the phenomenon, the unstoppable. It Works.
Haha 👍 Happy to help out. But I will take a look at two things:
undefined
error-value needs fixing.Will do that in the next couple of days when I have time.
But let me know if there is anything else and good luck with your project!
My dear friend.
It appears that this fix will couse some problems for a release in the app store.
@dabor238 I found the root issue. Your server uses TLS 1.0. Insecure. So it was refused. You should look at upgrading.
However. You can do this, and set an exception for your domain only to accept TLS1.0. This should have no problem in App Store. (Even though the other version with allowing all is no prob. either, have released multiple apps with it.)
Here is the Info.plist with the exception:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>www.multidoctores.com</key>
<dict>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
</dict>
</dict>
</dict>
</plist>
Thank so much for the information
@dabor238 FYI: I've just released 0.0.11 on npm. I should contain a fix for the undefined error
-problem you faced earlier. Please update and let me know if something is not working. Have you had any other issues?
I try to use this package, but the following error appears. Any help would be really appreciated.
My server info is: var connection = signalr.hubConnection('https://www.multidoctores.com'); var proxy = connection.createHubProxy('chatHub');
This info is already tasted in Web, Android and Ios native apps.