Unable to load webview in desktop on messenger - facebook-messenger

I created a facebook messenger bot. But the problem is I was unable to load Webview on the desktop but it works on messenger app in android.
I have already whitelisted the url which i wanted to load.
I looked at the console and saw the error in the screen at the console.
The iframe was unable to load because it set the iframe options to deny.
After i read the documentation.
So i need to confirm, is it definitely not able to work on desktop?

Yes, it is possible to load it on desktop. You just need to correctly set the X-Frame-Options header in your server/application.
X-Frame-Options: ALLOW-FROM https://www.messenger.com/
X-Frame-Options: ALLOW-FROM https://www.facebook.com/
Here is the Facebook documentation about this subject.

Related

Why can't I access GAE API in the explorer, but can open them in the browser?

I'm learning how to create APIs with Google App Engine.
When I try to call a certain method in the explorer, I get the response 404.
But when I open the very same URL (http://localhost:8888/_ah/api/quoteapi/v1/quotecollection) in a browser tab, it works.
Why?
How can I fix it (make it possible to call these methods work in the explorer) ?
Did you authorize the request using the toggle button on the right top of the explorer page?

Google Api - Key with file:// protocol

I have a little problem with the google api loading script.
I try to load the map api with this script tag :
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US?key=xxx"></script>
The problem that I have is that google keep telling me :
Google has disabled use of the Maps API for this application. This
site is not authorized to use the Google Maps client ID provided. If
you are the owner of this application, you can learn more about
registering URLs here:
https://developers.google.com/maps/documentation/business/clientside/auth#registering_authorized_urls
I have tries to set the allowed referers to "*", and to not specify any referer at all, but always get the same error message.
I think that it's because I'm in a phonegap (cordova) app and that the page where the script tag stand is loaded by file:// protocol...
Some of you have already solved this issue ?
Thanks in advance!
Cheers!
You don't need to use the map api key with file:// protocol. Google checks the web site domain, but file:// protocol does not have it, so you can skip it.
By the way, phonegap-googlemaps-plugin brings native Google Maps view into your Cordova app.
It's better performance (although less functions than Google Maps JS API v3).
Just for your information.

Access Custom Admin Page on AppEngine Development Server

I'm using Appengine and I want to write a custom admin page for myself. How can I view the custom admin page on the development server (on my localhost)?
The localhost console does not seem to have a link to it (even though it's defined in the .yaml and the page is working properly).
Thanks
Enter the URL in your browser, i.e.
http://localhost:8080/MyAdminPage.html

Accessing Google Calendar API from AngularJS APP

I am implementing (I am trying to implement) a 100% client side AngularJS web app which should access the google calendar API. Of course, this doesn't work because I hit the cross domain problem:
XMLHttpRequest cannot load http://... . Origin http://localhost:9000 is not allowed by Access-Control-Allow-Origin.
Is there any solution to bypass this issue, except creating a proxy? By setting some header or changing some google configuration? I don't see one ...
Great hint Philipp! The google javascript api client (see here) does the job.
But I am wondering: How does the google javascript api client bypasses the cross domain issue? Does someone know?
You need googles side to return the right headers, Access-Control-Allow-Origin, to your browser so it doesnt complain about the cross browser issue.
Make sure in the google cloud console is configured correctly to web application. Im assuming web app because the redirect though.
If its a phoneapp or not serving anything on localhost:9000 redirect endpoint there are other options. For example you could open up the oauth redirect in another window, still use localhost:9000 as the redirect. Even though you are not listening at that port you could still grab the url code or error that is set on the redirect from the parent window.
CORS is an issue that you will experience when running the app through web browsers. I suggest you download a CORS toggle extension on google chrome so you can toggle off CORS and the API will connect. Good luck!

Google Checkout displaying desktop version on mobile devices

The Google Checkout Mobile website says that "once you've integrated Google Checkout with your website, there's no additional work required to allow customers to buy from you using their mobile devices", but I'm not seeing this happening on either iOS or Android devices I'm testing. The desktop site comes up, which is workable, but not a very good UI on the small screen.
Since there's "no work required", I'm not quite sure how to start to debug this. Ideas?
I took some screenshots of what it looks like iOS 6 and Android ICS.
According to the support forums, Google Checkout for Mobile devices is just a big fat phony.
I'm just going to go out on a limb and post an answer because I noticed in your header link that there was no User-Agent set. The User-Agent server variable is often used to detect if the user is coming from a mobile browser or not. Here is Google's discussion about Mobile Redirects. So, my suggestion would be to try and set the User-Agent in your server-side code prior to your redirect. The whole workflow would be like this:
Detect the user's current User-Agent variable. Here is a PHP example: $_SERVER['HTTP_USER_AGENT'] and store this variable for later use
Receive the URL from Google Checkout
Prior to your redirect, set the User-Agent. This time, it's a cURL example:
curl_setopt($ch,CURLOPT_USERAGENT,$theUserAgentYouDetected); where $ch is the cURL instance. Here is a normal PHP example to set the user agent: $httpRequest->setHeaders(array('User-Agent' => $theUserAgentYouDetected);
Make your normal redirect
I hope this helps

Resources