I'm in the process of developing an FB app, which needs to be able to run in the usual desktop FB site (with surrounding FB livery), on mobile device browsers (I'm using HTML5 and Bootstrap to adapt the layout according to device), and within native mobile Facebook apps on iOS and Android.
In particular this last scenario - I'm trying to develop on my MBP and I'm using a local domain name (set in hosts) that points to my web server box next to me. In order to make that work from the iOS device, I have Charles running as a proxy on my MBP and have updated the iPhone wifi proxy settings so that all iPhone http requests are channeled through Charles, and therefore the iPhone can also use the localised domain name.
When testing through the mobile FB website, if i navigate to the test app I've created the FB mobile website launches the canvas in a new safari tab, and it works fine.
However, within the iOS native FB app, when I navigate to the app I receive a
"Sorry, something went wrong"
message in place of where the canvas content should be (see image linked below).
iPhone screengrab
Since FB forces https canvas URLs now I'm using the built-in self-certified certificate of my web server so that https can be served up. In the safari browser I initially get an untrusted certificate warning, which I accept and then I have no problems using my html.
Has anyone else seen this problem and know how to get around it? I'm assuming the FB app is having problems with the untrusted certs, but since the native app is calling a locally served (via proxy) URL, I dont see why there should be a problem (could the FB app be set to not accept untrusted certs?).
I really need to test my code within the iOS app otherwise I wont be able to prove to the client that FB works with my code.
Cheers
Lee
(p.s. I tried using 3G instead of the local wifi proxy in case something there was causing the problem, but it still didnt work in the native iOS FB app)
Turns out the problem was due to the mobile URL I had specified in the app settings was set to use https. Presumably this is because the native app won't accept untrusted SSL certificates (which is also probably why it was fine in the browser, because one can accept untrusted certificates).
Changing the protocol to http fixed the issue. Strangely Facebook doesn't insist on the use of https for mobile app URLs, so using http was not a problem.
Related
I am using a proxy for logging purposes and blocking malicious sites.
I recently installed a squid3 proxy setup with SquidGuard. I have my iOS devices connected to it and all it working well except for 2 apps. The iOS Facebook and Twitter app will not update content, and eventually times out. I actually want the content to update. This only happens when coming out through the proxy. If I turn wifi off and connect 4G it works. All other internet apps on the iOS device work except Twitter and Facebook. Any thoughts? I am using a very simple proxy squid.conf file and SquidGuard is blocking a bunch of spyware/ad domains, but not facebook.com or twitter.com or akami.com/akamihd.com. Thanks!
By the looks of it, the Facebook app for iOS does not support proxies at all. On my iPad, for instance, the app tries to connect directly to Facebook irrespective of proxy settings. One workaround is to redirect all of your device's traffic through a device that performs intercepting proxying
I'm sending an application request from my iPhone application and want the user to be redirected to the App Store page when he accepts the request.
In the application settings I've added the "App on Facebook" item with fake Canvas URLs besides "Native iOS App" in order to see the requests (they don't appear with no Canvas URL). Everything works fine in Facebook application on iPhone/iPad but doesn't work in the Safari browser on the device.
The request doesn't bring the appstore but open the error page:
Error
Sorry, the application you were using is experiencing a problem. Please try again later.
I've seen some other apps which works fine: request being clicked in the browser brings appstore. So guess something is missing in app settings or similar. Any clues?
Have you tried using your app store link as a URL?
I'm creating a mobile website, which I have been testing it through symbian browsers(Nokia). Sessions established are all working fine in it, but when I did my test in an iPhone, despite being able to log in, my session variable seems to be empty. Is a different approach needed to for iPhone? Or am I doing something wrong?
FYI:
I'm using php sessions(session_start()).
Make sure that the iPhone is configured to accept cookies: Check the "Accept Cookies" setting under Safari in the Settings app.
I recently realised that Safari in iOS manages cookie separately for Safari.app and other apps that embed UIWebViews. I concluded so because I developed browser based app and saw the following behaviour:
login to web service which then sets session id to cookie.
when I go to safari app and access the web service, I was asked to log in again.
Is it true that Safari in iOS manages cookie separately for safari app and other browser based app?
Yes, you are correct.
Every app is sandboxed, meaning is has no access to any other app (which Mobile Safari is).
Thus, cookies set in a browser-based app will not affect the Mobile Safari app.
See this question for a possible workaround (kinda): Setting a cookie in an iPhone App
It looks like you are trying to track your mobile app installations. I would recommend checking out yoz.io because they are free and do not require an sdk.
Enjoy ;)
I'd like to build a mobile Web app that:
If my iPhone app is already installed, launches it by redirecting to a URL handled by the app
If my iPhone app is not installed, displays a web page encouraging users to download it from the App Store
The problem is, I don't know how to detect whether the app is installed before redirecting. Does anyone know a trick for doing this? Maybe a JavaScript hack of some sort, leveraging the App registered URL in an iframe or similar?
You very likely can't do this. Even in a native app, all you can call is UIApplication's canOpenURL: method, which just tells you if some app will open the URL, not which one. I have no idea if this function is exposed in JavaScript; very likely not (I wouldn't want malicious javascript probing my phone for which URLs it can open).