How to redirect inside PWA application - progressive-web-apps

Domains of our project are always get in black list.
How can we send information to PWA about new mirror-domain and get it redirected to it?
When the domain is getting blocked, service-worker doesn't wake up at all and we see page with error. How can we wake it up and make request to our redirector for new working domain?

Related

Instagram API Redirect URI SSL for localhost without the Warning

Instagram API requires redirect uris to have an SSL certificate (HTTPS connection).
I use Instagram API for my mobile app, and OAuth response should first invoke procedure in the app.
I am able to create a server to catch this call locally (on 127.0.0.1), but for the certificate, I can only create a self-signed one. The problem is that the browsers don't trust it and initially warn the user about the potential hazards, which is unacceptable for the user experience.
I saw a few similar questions on Stackoverflow, but unfortunately, I couldn't understand if they solve my issue.
How to avoid this warning?
Basically, even if they warns about https you can use api's. I had the same issue but I just tried to run the application on https port instead of http on localhost and it worked. So, Answer is you just need to run your application on https.
I have a solution for my specific case; I use Flutter for the mobile application. But overall you can find something similar for other cases as well.
Initially, I was launching the Instagram authorization window with url_launcher package. Basically, for iOS it launches the url in-app, but in a Safari Web View. In this way I am unable to control the flow in this web view. So, what I wanted to do is to catch a request to 127.0.0.1 when authorization is completed by running a local server in the app. It does work but throws a warning about security hazard due to a self-signed certificate, since Instagram requires https being used and 127.0.0.1 cannot have a trusted certificate.
Instead, now I launch the Instagram authorization window in-app with custom WebView using webview_flutter. It provides more flexibility, but most importantly I can track navigation. So now, Instagram redirects my user to the non-existing page on my website, which has a trusted certificate (but it doesn't really matter), but the aforementioned WebView can detect this redirect, parse the URL to retrieve the wanted code and prevent actual redirection by closing this web view. So, eventually, I get the wanted code in the app, so I can send it to my backend with extra user id reference.
So, basically, the workflow looks like this:
User clicks a button in the app to connect Instagram account;
The app launches a custom web view and opens Instagram authorization page;
After authorization, Instagram redirects the user to a dummy URL with the wanted code as a query parameter;
The custom web view detects this redirection;
Retrieves the code from the URL;
Closes web view (returns to the main app screen).

Facebook Login "500 internal server error" in touch mode

We are using the method described in https://developers.facebook.com/docs/facebook-login/login-flow-for-web-no-jssdk/ to log users to our web site.
It was working fine since the last week. Now what happens is that
in mobile devices it does not automatically redirect to our site
after the user logs in.
Instead, the FB server returns a "500 Internal Server Error" error.
But this only happens with the mobile version of the login page
(option display=touch), with the desktop version the redirection
performs well.
This works:
https://www.facebook.com/dialog/oauth?client_id={myAppId}&redirect_uri={myurl}
This doesn't work:
https://www.facebook.com/dialog/oauth?client_id={myAppId}&redirect_uri={myurl}&display=touch
As we didn't know if the service was down for whatever reason
or there was a problem with our FB application,
we have created another FB application and we have set the web site
to a known url: www.google.com.
Then we have tested the url:
https://www.facebook.com/dialog/oauth?client_id={myOtherAppId}&redirect_uri=wwww.google.com&display=touch,
and to our surprise it worked, resulting in a redirection to the
google search site.
But if we set our web site in both the test FB application and the login url, it fails again with the same "500 Internal server error".
So we suspect that there is something wrong with FB and our domain.
Could FB be blocking my URL when trying to redirect through the mobile version of the login dialog?
We would like to contact the FB support team directly by email but we are unable to find a way to contact them.
Can anybody give us a clue on this?
Sometimes it's because your app is in Sandbox mode.

How to become redirected to Facebook's Mobile Web URL

I would like to integrate an existing, external application with Facebook using Mobile Web method and its authenticated referrals as well as to be able to redirect user (incoming from a different place) to Facebook login page. I do not want it to be embedded in Facebook page.
If I understand correctly how the authenticated referrals work, I must somehow reach the authentication dialog which will redirect me to the Mobile Web URL, which I specified in the application configuration.
Additional information: I would like to avoid making the application public until it is ready, so I have set the Sandbox Mode setting to Enabled.
How to get the URL, with which I will be able to test authenticated referrals?
You can land at your game's Mobile Web URL page using following steps:
Switch your user agent to iPhone or other mobile.
Go to the http://m.facebook.com page.
Press the "identity" icon in the top left edge of the screen to show the bookmarks menu.
Look for the application in the Apps section.
Press the application bookmark.
Above procedure worked for me. My user was an admin of the project but it will probably work also for devs and testers (just a guess).

Infinite Reload With Rotating State Param in Facebook Application

Infinite Reload With Rotating State Param in my facebook web app, this problem occur suddenly and suddenly all fb app on my server stop working
Page is refreshing again and again and not able to open ,
script work fine in other serverbut fails to work in this , is there any server config to handle facebook app.
You can chk issue at Link - gomandi.com/visit/
State Token is Refreshing again and again in all website hosted in my server , Looks like some Server confiG. issue is there . Can anyone help me with this.as i am my server support team unable to find this issue why my server fails to connect with fb server or viceversa.
SAME APP WORK IN OTHER SERVER !!
Based upon the comments on the question above, what you need to do is to create a brand new app for the different domain names. So you can have specific URLs for each domain specified in each of the app's app settings. So if there are three domains, then I'd recommend three apps configured correctly to point to each of those three domains.

Facebook App - profile tab does not load

I'm writing a new facebook application with all migrations enabled. The canvas page loads. Profile page (fbml) doesn't load. When accessed page loads with the facebook ajax loader animated icon and just hangs there indefinitely. Facebook is not hitting my public server for the profile tab page. I've a servlet that can handle both GET and POST at this url.
The app canvas page is accessible at http://apps.facebook.com/sensei-shelf
The app profile page is mapped to [canvasUrl]/profile.html and is accessible at apps.facebook.com/sensei-shelf/profile.html
I've set this as the profile page in my application's settings page. The profile servlet is capable of taking both GET and POST requests. The application is hosted on Google AppEngine. So from logs, I know there is no incoming requests from facebook when a user clicks on the profile tab of the app.
The profile tab default column is to wide.
Any solutions/suggestions/workarounds please?
Regards,
Krishna
When I visit http://apps.facebook.com/sensei-shelf/profile.html I get blank output. Did you try that and verify that you can see requests coming in when a user loads the profile.html via a canvas url (http://apps.facebook.com/sensei-shelf/profile.html)? Maybe Facebook is having problems resolving your domain? Seems weird that the FB proxy servers wouldn't be able to get to your application at all...