iPhone/iPad says 'Download Failed' when trying to load website - iphone

I have a weird issue. Whenever I do something like login it will create the session, but then say 'Download Failed Safari cannot download this file' and doesn't redirect. If I go the the actual page that it should have redirected me to I am logged in. The same things happens any time you do anything such as logout, upload content, etc.
It only happens on iOS devices in Safari on 3G. Wifi it works just fine. Chrome on the iPhone works fine on 3G. Obviously its like its trying to download something, but I can't seem to figure out why this is, or why it is.
It happens when I am login in to my profile, but if that profile is public and I just go directly to that page without logging in there is not issue. Make sense?.....
The site is built in Codeigniter. If any one has ANY sort of idea that would be great!!!

Set up your device to use a proxy such as Charles. Look for the differences between a successful request/response and a failed request/response.

The problem had to do with a server configuration that was causing the issue. Even thought I had $config['compress_output'] = FALSE; set it was still utilizing gzip. We turned it off in the server configuration and it fixed the issue.

Related

Facebook login worked on localhost but not on hosting

We have a website that uses Facebook for login, when we run it locally used to work fine. We had a Facebook application with App Domains and Site URL pointing localhost and worked just fine.
However, when we moved into production, we uploaded the site to our hosting and changed the setting in the FB app to match this change.
Now we put "xxxx.com" in App Domains and "https://www.xxxx.com/" in Site URL (it works in both HTTP and HTTPS).
However, when trying to log in I get a 401 error.
I tried every different combination in the FB app that I could think of but still it's not working.
It can't be the code because used to work fine running it in localhost with the app set-up pointing to localhost but I can't make it work on our hosting...
Any ideas?
HTTP Error 401 - Unauthorized
The error code says it all.
See if setting App Domains to blank will help.
If your using an iPhone app go to settings and go to wifi. Click on your wifi. Now go down to renew lease. Click on that. This will solve the problem. I had the same thing happen to me and nobody had an answer. It took me an hour of messing with my phone to find this solution. Hope this was helpful for you.

FB.init() callback stopped been called

I know that there are similar question, but I think that my situation might be different.
I have two facebook applications. One is for develop - it works in sandbox mode and works with localhost. The other one is for production, with the sandbox mode off and an active ssl.
I haven't used develop app for some time, and now I've found that FB.init() is not called anymore. However, in Google Chrome browser everything works fine, and production server works in all browsers. What can be the reason of this problem? Did Facebook got some king of update or something like that? Maybe it stopped to work because develop app needs SSL too?
Took me some time, but I figured it out. Now to use your develop non ssl applications on facebook, first you have to go into Security tab in facebook account settings and set Secure Browsing to disabled.
What I can't understand, why I haven't got any notification from facebook about this issue? If there was some kind of notification, then it was too hidden.

Cannot set a cookie before redirection

We have a weird problem in that I have developed a mobile version of our website that just sits in a sub folder of the site e.g /mobile/page.asp (I know .asp classic don't blame me!)
I did want to create two domains one for the mobile site one for the normal site but I was told by our CTO to just do a sub folder.
However the problem is we want to be able to set a cookie that lets us know whether the user WANTS to be on the main site OR mobile site. They could in theory be on a desktop and still choose to go the mobile version (as we have links in the footer to switch views, e.g from the main site to the mobile site and vice versa).
However if someone comes to the site without a cookie set we do some user-agent sniffing do determine their device and then set a cookie before redirecting them to the right part of the site.
All our logic seemed correct however when we started testing it we started getting weird results.
On my iPhone 3gs it was working perfectly (most up to date OS) however on other peoples iPhones or Android phones people would
-clear cookies (at the beginning of the test)
-visit the site
-the agent sniff would redirect them to the mobile site
-but when they clicked on a further link on the mobile site the code took them back to the full site.
This didn't happen for me - also on our demo site it worked for some people and not for others - and also for someone on an Android device who downloaded FireFox it worked fine.
I and another developer who had the problem sat together and went through the steps one by one, doing the exact same thing, with debug on showing us what was going on.
However whilst I was getting a cookie set to "mobile" when I went to the mobile site he for some reason wasn't. It was like the cookie couldn't be set before a redirect even though the redirect was to the same domain.
I read some articles which said there was some issue in webkit with cookies and redirects which made me think this could be the issue on the iPhone Safari browser but that wouldn't explain why my 3Gs phone worked.
We have tried re-working the code but we need to be able to set cookies and do redirects in all cases. We even tried just changing the code that was setting a cookie to a session variable but even that didn't work.
I am really stuck and so is everyone else. We have spend days trying to debug it but cannot find a common denominator which would explain why it works on some devices but not others.
Can anyone help!!! Any advice would be much appreciated.
Thanks!

Custom facebook page tab issue

So, for whatever reason, some people can't see the custom facebook page tab. Not sure why, especially when I can see it just fine.
Link: http://on.fb.me/rKNxUS
Let me know if you need more info.
Do you have a https version of the page tab? If they're account always uses ssl and you don't you might run into issues. Other times I've seen resetting the app secret help with issues like this.
It shows a standard browser error page to me. "This webpage is not available Google Chrome's connection attempt to incontrolwebsites.com was rejected. The website may be down, or your network may not be properly configured."
May it be possible you didn't upload the webpage to the production server?
If it opens correctly from your machine: check that you don't have a custom DNS setting to point to your local webserver instead of the production server.

problem with UIWebview and link to App Store

In my iPhone application I have a UIWebview that shows an html page. Inside that page there are links that should lead the user to the iTunes application and the application they tapped on. However, when the user taps on the link it errors out with 'too many redirects'. Looking at it with a packet sniffer I see it just keeps redirecting to the same http://phobos.apple.com/... URL. I even tried changing the link scheme to 'itms://' but that results in a 'Cannot show URL' error. I could solve this problem by trapping the URLRequest and sending openURL: to the UIApplication but the app has already been deployed and I don't want to patch it. I rather do it on the html/js/server side if possible. Anyone have any ideas?
For anyone still searching for this answer, I found that it seems to be a problem on the simulator which doesn't support itms:// URLs (because there's no App Store app). I didn't see the same issue on hardware, where the App Store app opens just fine (in my case this was when testing URLs from AdMob adverts, but it's probably the same for UIWebView).