Loading articles through an iframe in a mobile app and its cookie implications - cookies

I am trying to create a mobile app that loads webpages within an iframe. Let's say a user loads a webpage from website A and then says "yes" to the typical "do you want cookies?" modal. And then let's say the user loads the iframe again for website A. I would like to not show the "do you want cookies?" modal again to the user.
It seems like browser like google chrome would consider cookies from website A a third party cookie and would not save it (link), which means that the website A would not have saved cookies in the user's device and would ask the same "do you want cookies?" question again to the user.
How would this play out on a mobile app that I created? Could I accept third party cookies so that website A would be able to save cookies in the user's device and avoid asking the "do you want cookies" question again?
If not, would there be a way to programmatically "agree" to "do you want cookies" question? Based on my research it seems like every website is loading this modal slightly differently so it might be a bit difficult to implement in scale, but just wanted to confirm.

Related

facebook page widget shows different app id when user not logged in facebook and try to like page

I have Facebook page widget, and i want to track if user liked my page or not. If not then force them to like. I did code for that, but now issue is when user try to like page and not logged in, Facebook open login window and app id is different on that window(which is default, don't know from where it takes).
And because of that, users not able to authorize my app. And i cant track details of that users.
Make sure you are using Page Plugin, instead of the now-deprecated like box. It's hard to say without seeing any code, but it sounds like you are either using the SDK/plugin incorrectly, or using something like a 3rd party wordpress plugin that may be acting maliciously by injecting another ID.

Can I prompt a user to log in to facebook through a bookmarklet generated div?

I'm looking to see some info about my facebook contacts, and I want the info to be overlayed on the currently open website.
Currently, I'm trying to do this via a bookmarklet.
Is it possible for me to overlay a div over the currently open web page and populate it with a functioning facebook login button (if the user is not logged in)? Are there publicly available working examples of something like this?
It is probably not possible to simply embed Facebook within an iframe because Facebook blocks people from embedding their pages within frames or iframes by putting this into the response header, "X-Frame-Options: DENY". This is most likely to prevent click-jacking and similar security exploits.
To test this, enter any page from Facebook into http://savanttools.com/testframe
Facebook has an API which allows you to do many things, but it requires server side code, and can not be done simply with a bookmarklet.
There is also always the brute force method where your server scrapes data from any website you want it to. Then that data could be put into a bookmarklet.
Finally, the same thing could be achieved by writing an add-on or a user script without using a bookmarklet at all.

Is QtWebkit needed to fetch data from websites that need login?

As the title implies,
I need to fetch data from certain website which need logins to use.
The login procedure might need cookies, or sessions.
Do I need QtWebkit, or can I get away with just QNetworkAccessManager?
I have no experience at both, and will start learning as I go.
So please save me a bit of time of comparing both ^^
Thank you in advance,
Evan
Edit: Having read some related answers,
I'll add some clarifications:
The website in concern does not have an API. So I will need to scrape web elements for the data myself.
Can I do that with just QNetworkAccessManager?
No, in most cases you don't need a full simulated web browser. In most cases, just performing the same web requests like a web browser would do is enough.
Try to record the web requests in your browser, using a plugin like "HTTP Live Headers" or "Firebug" in Firefox. I think Chrome provides a similar tool out of the box. These tools record the GET and POST requests done by the website when you send a form in the webpage.
Another option is to inspect the HTML code of the login page. Find the <form> tag and its fields. Put them together in a GET / POST request in your application to simulate the same form.
Remember that some pages use randomized "tokens" in their forms, some set the tokens as cookies. In such cases, you need to request the login page itself in your application first (before sending the filled in form). Both QWebView and QNetworkAccessManager have cookie support.
To sum things up, I think QWebView provides a far more elegant way to simulate user interaction with a web page. The manual way is, however, more "lightweight", as you don't need Webkit and your application might be faster (because only the HTML page is loaded, without any linked resources like images, CSS, javascript files).
QWebView as class name states is a view, so it views something (in this case web pages). If you don't need to display loaded page, then you don't need a view. QNetworkAccessManager may do the work, but you need some knowledge about HTTP protocol, and also anything about target site: how does it hande logins, what type of request you have to send to login etc.

Facebook communication to Application

The start-up i currently work for is oriented around restaurant wait times. For our v1.25 specifications our clients -restaurants- that have Facebook pages want to be able to communicate to their app profile from their Facebook page.
The closest i have came to answering this question is the Graph API. However, the Graph API only allows us to read and write data to FB pages. So, is there a way for a restaurants FB page to write to its app profile? Secondly, Loso, whom we have modeled some of our designs from has this ability, does anyone have an idea as to how they have done it?
--Boris M.
Here is an option that you can consider...
When you are designing the app you can also develop a page tab to go with it...
You will find this option in the basic settings of the app.
You can make it to install for all first time users of your app, by getting a list of all his pages he created using that profile then install it on the one he selects.
This page tab when installed on a page will appears just where other tabs on the page appers(e.g. events, notes etc. occurs)
You can provide your required functionality on this tab as you like.
Thus the user can just select that tab on the page and use its functionality to post on the profile page of the app.
Hope this works for you... and also u can check out the jobcaster app it does something like that!

Help with design a facebook integration for my website.. App or Page?

I´m building a website to post my own videos using JW Player running my own ads as overlay.
www.planetsnowmobile.com
All my videos will be
Instead of register my own users, having my own forum etc etc I want to use facebook to interact with my visitors:
Individual discussions/comments on individual films instead of my own comment/forum-function
facebook-like-button for individual films (so induvidual like buttons for individual films)
Share induvidual films
Grab location from every unique visitor
Where do I start?
Do I need to create an application or should I use a Facebook "page"?
Maybe both?
I see that i can add an application to a "page" but what does that really do? How do I use that?
What would be the best way for me to do this?
I already have a Facebook "page" for my website and I just created an App as well.
Which one should I use?
Do I need both?
What is the difference?
I know that I can create a like button for a website address on http://developers.facebook.com/docs/reference/plugins/like/
But can I monitor that like button from example an application if I can connect them somehow?
Is that something I want to do?
My Facebook-page already have a user-base where my Facebook-application does not.. is my best option to delete my "page" and start all over with my "application"?
App is their encompassing term for any application that uses their API, this could be on Facebook or on your own personal website - these require an API key to make authenticated calls for users. Pages are FB's own in-Facebook content that users have created, like page for a business located at facebook.com/mybusiness. It sounds like you already have a website and want to add Facebook functionality to it, so you don't want to make another Page. You may not even need to create an App. Things like comment boxes and like buttons can be dropped in as stand-alone copy-and-paste widgets. You can track the like button by enabling FB insights for your website.
So like you noticed you can add a like button to your page using the social plugin from http://developers.facebook.com/docs/reference/plugins/like/ - similar to the like button you can add comment boxes with the plugin at http://developers.facebook.com/docs/reference/plugins/comments/
You can track the results from these plugins by adding your website to Facebook's analytics (Insights) at http://www.facebook.com/insights/
Most of these things are powered by the opengraph metadata in the headers of your website's pages. You can read up on what tags FB uses here http://developers.facebook.com/docs/opengraph/
Everything at http://developers.facebook.com/docs/plugins/ can be used without an application or page ID, and is very good about being responsive to the page they are hosted on: you can add a like button to your video view template without a defined URL in the like button's parameters, and it will automatically direct any likes to the url of the currently viewed video.
You could also direct a like button to point to your existing FB Page, in which case any likes collected from it would be added to the Page's total. Most companies that have a home-page like button do this, so their likes all accumulate to a single total for their business.
Hope that helps.