Setting up PWA break php authentification/redirect - progressive-web-apps

I added PWA into my site using that tutorial:
https://github.com/yarekc/pwa
The goal of the PWA is simply to add home page start icon.
After adding that script to my index.php, people could not enter my website anymore: the authentification session/redirection page was leading to index.php
This was happening in chrome users.
I had to remove the registerSW.js page so people could enter again.
Any idea of what could cause that bug ?
Regards

Related

Landing on a subpage on my Wix website redirects to the home page

My website on wix (https://www.villotec.com/) has a bug that I am having difficulty fixing. For some reason, when I go on a webpage that is not the home page (https://www.villotec.com/lorawan-lightning-detector for example) , it redirects to the home page as soon as the page is loading.
Why does this happen? Is there a setting on Wix that I turned on automatically?
I had the same problem. Figured it out though. If you're using the Wix Language Menu, go into the settings and click the Redirect Tab. It defaults to "Automatically redirect all visitors by their language". I set it to No Redirect and that fixed the issue for me. Hope that helps.Screenshot of Language settings

Facebook page tab game, x-frame-options

i have javascript game on my facebook tab.
When user is done with the game, it has option to submit his name and so on - it's done by clicking on a link that leads to same domain, even same folder where my app is located, it's just different file with form.
But I'm getting Refused to display document because display forbidden by X-Frame-Options in every browser except google chrome.
What m'i doing wrong ?
Adding:
Header always unset X-Frame-Options
to my the top of my .htaccess file helped me fix this issue on a shared hosting site where a Facebook Page Tab APP was located.

Facebook App : This must be derived from Canvas URL, Secure Canvas URL

Hi I wan't to create a facebook app to use it for the auth in my new site locally installed(my machine),but from yesterday I don't succeed to install it and use it, all time I have this very strange error when I wan't write a domain in the "App Domains" :
This must be derived from Canvas URL, Secure Canvas URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains
the domain of my application is http://localhost/project/app_dev.php/ it dosn't work I change it by a real url such as : http://www.exemple.com/,but I had the same error,and just I notice that I see this error when I create an app with new look of facebook (yesterday)...
In my case the problem was I hadn't completed the "+ Add Platform > Website" section. Once I did that the contents of App Domains became valid and the error went away.
I had this same problem yesterday, the stackoverflow answers that helped me the most were
Make local development work with Facebook/Google APIs and Canvas URL / Secure Canvas URL error message ( Also checkout How to handle OmniAuth callbacks in multiple environments?)
The Facebook developer UI has changed a bit. I'm writing this answer to consolidate all the info that helped me.
1. Make local.host Point to Your Computer
First thing you need to do is (as answered in the first link), facebook won't take localhost as a valid callback site, because it confuses localhost with a top level domain (com org etc.) in other words there is not dot . in your domain name. So change your /etc/hosts to add the entry
127.0.0.1 local.host
Now youcan access your app at http://local.host/... (this will take effect as soon as you save /etc/hosts file, no need to restart anything)
2. Add local.host as the Site URL on the facebook Dev Console
The second thing you need to do is add local.host as the site url on the facebook page
Now don't use your production app. Add a dummy app on your https://developers.facebook.com account Because your production app will have to set the site URL to your production URL and not local.host
Configure the dummy app as shown in the screenshot. But that website section(shown in the screenshot) won't be visible on the Basic settings page from the beginning.
First you will have to click + Add Platform button at the bottom, and select Website.
Notice I added http://local.host:3000/. That's where my ruby server runs in dev mode.
Also, be sure to use App Id and App Secret for the dummy app when running your webapp in dev mode.
HTH.
My problem was that logging in with facebook wasn't working for my app.
It turned out that I just needed to fill in the "Valid OAuth redirect URIs" field on the "Advanced" tab.
e.g. http://example.com/auth/google/callback
I'd a similar problem, Facebook have changed now on left pane file login (After selecting you app from top left corner) -> Valid OAuth redirect URIs
If you work on desktop app like WPF or winforms and use a WebBrowser Control to log in with the Facebook SDK.
You have to set to yes the Embedded Browser OAuth Login in Advance Tab of your facebook apps setting.
hope I help
Chose "Add platform" at the bottom and give your localhost url. "http://localhost:port/".
After this step. Facebook allows you to add localhost:port as your domain url.
After these 2 steps you can test "login with facebook" without any trouble.

Add application to page: not visible

I just added 3 applications to my page using:
https://www.facebook.com/dialog/pagetab?app_id=[appid]&next=[siteurl]
That all works fine, it redirects me to the [siteurl].
However, the apps don't show up on the page. In "Edit Page" -> "Apps" the apps also aren't visible.
Any idea what causes this?
Thanks!
It could be that the app is in sandbox mode and the account you're checking the "edit page -> apps" section does not have a role within your app, so they can't see it.
The dialog could also be failing. It's fairly recent and I've spotted bugs with it already. Try using http://www.facebook.com/add.php?api_key=APP_ID&pages=1, replacing APP_ID with your app's ID, to see if that's working.
Fixed it!
The problem was that I defined the secure page url, but not the non-secure page url (while we don't use the non-secure page url anymore?)...

Facebook Tab on pages

Whats the best way to develop a tab on facebook in a facebook page with content inside it? Would it just be html within that tab?
Easiest way is to install a 3rd party iframe App on your Facebook Page. You can find these Apps by searching for "iframe" in Facebook's search. Once you have one of these Apps installed, you can customize the HTML/CSS/JS of the iframe, which will then be reflected on you Page Tab. Alternatively, you could create your own Facebook App and install it as an iframe in your Facebook Page. This will achieve the same thing, and may give you more control, but you will have to host the html/css/js files yourself and it will be more work.
I recently have the same need.
To just place a facebook tab containing just a static html with text and image.
Here are the steps. It can be quite a nightmare to review the documentation of Facebook since it is always in change.
In the home page, click in the settings button. There is a link "Create application". You have to be sure to be in the Facebook development section
In the Create Application home page. In the upper menu there is the button "Applications". Here will be listed all your applications. If this is the first time, again the button "Create a new app"
3.Enter the information requested. Name of the application, an identifier (I prefer the same display name without spaces) and choose a category.
As a security step, a captcha is shown. Just fill with the characters in the screen.
Since your tab is an html. You have to host this file in your own server in order to have a path. The first tricky thing here is to convert this file into a php, asp, or similar extension. since Facebook uses GET or POST protocol to send information. You have to ensure that your file understands this requests. So, your server must accept the corresponding programming language. Even if your tab doesn't have any real code.
The configuration of your app is shown in screen. In the left menu, the option "configuration" displays the options to activate your tab.
click "Add plattform" button and select Facebook tab
fill the information required with the corresponding URLs. Note: Facebook always requires secured URLs so make sure that your server or hosting service has the SSL certificate validated.
Upload the image of your tab to be shown in the home of your profile in your tab section.
ok, so far we are good. Now. This was a long search. There is no longer the "Add to my webpage" link anywhere. So use this link to access to that hidden link. here Basically you enter the facebook app id and the URL of the hosted file.
Then you select the facebook page where you want to link this tab. And that's it!
note: the alternative to the link is this: (https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL )
Hope this helps. It was a waste of time when I have to search for the details so I want to share this.