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 ;)
Related
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.
I have integrated Facebook functionality into my applications. By using the link https://github.com/facebook/facebook-ios-sdk, I have integrated the Facebook. In this application, at the time of login, it's opening Safari and at the same time the application is going to the background and then after login again it's coming back to the application. My intention is that this flow can accept the application store or not.
This is the official Facebook iOS SDK and many apps in App Store already use it. So you can use it inside your app.
Also, the flow in your question is exactly what the documentation of the library describes and is, again, used by apps that are already in App Store:
If the device is running in a version of iOS that supports multitasking, but it doesn't have the Facebook app of version 3.2.3 or greater installed, the SDK will open the authorization dialog in Safari. After the user grants or revokes the authorization, Safari redirects back to the calling app. Similar to the Facebook app based authorization, this allows multiple apps to share the same Facebook user access_token through the Safari cookie.
So, yes, there is nothing wrong with this flow.
We have a popular Facebook Application and a version of our App for the iPhone. I was wondering how we can make our Application appear in the "Apps" Section on the new Facebook iPhone app. On my iPhone I currently see links to the App store for Pixable, Badoo, Airbnb, Foursquare and WhoisNear iPhone Application.
I have filled out the Native iOS App settings in the Developer section on Facebook (including adding the Bundle ID and the iPhone app store ID) several weeks ago thinking it took a while to update, but still nothing shows up on my iPhone app.
Any help would be appreciated.
Best,
M
Screenshot of where we want our app to show up:
Edit your Application Settings and on the Basic Settings specify a Mobile Web URL for your Mobile Web integration. You should be able to set the URL to your app's iTunes URL.
Fill out the iOS information within the admin settings of your application, which also means they are using the same application id. You also have to have granted at least the basic permissions via connect on the app, and have the app installed on the phone.
I want to access TTS (Text-To-Speech) and STT (Speech-To-Text) functionality of iOS from web app. Since web app dont access ios device functions, is it possible to launch Native app from Web app?
e.g. When user wants to access TTS (e.g. Dragon Dictation), web page will launch Native app, take recording and send the recorded text to web app again.
Or we can access TTS/STT functionality right from web app?
The only native apps you can access from web apps are those with custom URL schemes set up, and the built-in ones e.g. SMS (sms://), phone (tel://), iTunes (itms://) and YouTube (http://youtube.com/watch?...).
If the apps you mention don't have their own custom URL schemes which you can use to get to them, there's no other way you can do this.
I can answer one part of your question - using the functionality of an IOS native app from a web-app;
Apps can be developed such that they respond to custom URL schemes - like, for example, the mail app responds to mailto:// and youtube responds to youtube://. Calling a URL with one of these schemes will start the IOS app - but it's entirely on the developer to code this into their application.
You could therefore in theory develop an app to get triggered from a web-app, perform an action then return to a web app after! Probably not something I would try and do though.
I am working in face book functionality in my apps. I have integrated the latest Face book-IOS-SDK. When runs the application, the application is started and runs in the safari browser. Now I want to load the application in the user view(FB web view) instead of Safari. How can I achieve this?
Facebook doesn't want you to. Facebook's new SDK wants the user to login into Facebook once, and than that Facebook login be used in every app on the device that uses Facebook. Because of the way the iPhone works, the way they had to do that was through safari so that each app could get that info. You can go back to the original way (which so far I personally prefer), but I'm not entirely sure how.
However, if you use the new way, it will automatically redirect the user back to your app once they finish authenticating it. Also in the Safari page they can give your app permissions, ie. post status updates.