In my app i am calling image from url,its working in simulator but in device it shows tunnel failure probelm. I then appended "deviceside=true" if i test it in simulator and "interface=wifi" if i test it in device both shows "Unexpected Response code 301" error. Why it is so ? Guide me.
301 is a "Moved Permanently" code. The actual body you receive will probably say where its actual location is. The browser gets this and can make sense of it, knowing to just forward itself to the new URL, but a normal connection is just grabbing the contents of whatever is at that location.
You can add some logic in there to follow the redirect, or just figure out what the actual URL is.
Related
When sending a GET request in Safari, Safari is failing to send a valid request to the server. In fact, it isn't even reaching the server (I've checked this on the back end). Its also failing to provide all but two of the request headers and the response is null (which results in safari logging a kcferrordomaincfnetwork error 303 in the console). I've attached some screenshots below along with some additional findings. Can anyone provide any insight?
Screenshot of the request when it fails
Screenshot of the request when it passes
Issue is only reproducible in Safari on iOS devices.
Issue was happening on the MacBook previously. After clearing the website data once, we never saw the issue again
The call is intermittently failing
When setting a breakpoint before the product details call and manually calling it in the console, it fails the first time and then passes the second time.
Sometimes it isn’t the product details call that is failing (although it usually is)
Sometimes it is the create app or get product image call that fails.
Issue seems to go away after clearing website data, but comes back after one successful session.
When the call fails, we are getting the following error in the console: kcferrordomaincfnetwork error 303
Session storage is empty and issue persists
No exceptions are occurring (I enabled "break on all exceptions" in Safari)
Try running ng serve with the --no-live-reload option. We were seeing similar behavior, and WDS may have been interrupting the HTTP calls. So far, this has solved our problem.
Problem:
HTTPS GET returns empty response if sent within 1-2 seconds after returning to the app from the lock-screen.
Steps to Reproduce
Start my app. It shows a newsfeed in a TableView on the screen.
Lock the iPhone.
Unlock the iPhone
Within 1-2 seconds do the pull-to-refresh on TableView so it sends HTTPS GET request to YouTube to fetch the list of videos from the particular channel.
Expected Result: I get the response from YouTube with the list of videos.
Actual Result: I get "empty response" log from Moya.
Note: the next same pull to refresh works. If you wait for 2 secs and do the pull to refresh - also works perfectly. STRANGE!
Context:
iOS
Swift
Moya
Who knows why? Any clue? Broke my brains.
UPD
The link to the code: https://yadi.sk/d/Feu0FZkdu9ogr
Please try and experience it.
I have webview working fine for version less then ios9, but seems not working for ios9, and its shows me a blank page, but the url is passed.
You may want to check the order of updating url and rendering page. In ios9, url will not be changed immediately, even if you directly assign value to it.
So you can try to set a timeout to wait until url updated.
updateUrl();
window.setTimeout(function(){
renderPage();
},30);
sometimes set timeout to 0 would do the trick, because it forces the code runs in the next event loop.
I'm working on an iOS app where I now want to integrate ChromeCast support. I use the HelloGoogleVideoCast example to test my hardware setup and get inspiration for my app.
I have now stumbled on a problem that is present both in my app and in HelloGoogleVideoCast. When I connect to a device (connectToDevice method in HelloGoogleVideoCast) I get error "The operation couldn’t be completed. (com.google.GCKError error 2.)". I have power-cycled the device with no change in behavior. I never get to the callback deviceManagerDidConnect, instead deviceManager:didFailToConnectWithError is called with this error. Still, I can connect with the iOS YouTube app.
I can't find anything with substance if I google it and I can't find any good ChromeCast developer forums.
Is there anybody who has an inroad to how to solve this?
I m not sure it will help but u can try:
Download the Chromecast app from app store:
chromecast link
After u see your chromecast -> select your chromecast -> General -> make sure both check box are selected (I know the text is nothing to do with your problem).
Try now.
If the error still occur, try to reboot your chromecast.
If your error still occur, try to reset your chromecast, and then check the boxes again (don't forget!).
Make sure that you initialize the Receiver Manager in your receiver app as soon as possible. Don't wait for the window.onload. If the receiver takes too long to load and initialize the receiver manager, the connection is automatically torn down.
I had the same problem as you did and making the following changes on receiver worked for me:
I've put the script src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js" inside head tag and before title tag;
I've put my script file which managed all cast functions after
body tag (actually I've put all script declarations, except for cast_receiver, after body tag, including jQuery);
I hope it can help you yet :)
I am using AFNetworking to update location details to a server in the background (using significant location change).
Everything works fine, except when driving round and it attempts to upload to my server and my phone has no data signal, when I re-launch the application later it has UIAlertViews on the screen saying "The Internet connection appears to be offline."
I have done a search on my project for the string, but it doesn't exist. So where is it coming from?
I would like to stop this being displayed when the app is backgrounded.
Thanks
That error message is passed to [NSURLConnection connection:didFailWithError:] when the Internet is offline. I believe AFNetworking passes this to a failure code block or delegate callback depending on your implementation. You have code somewhere to make a UIAlertView display text from an NSError object but that string isn't in your project so that's why you can't find it.