New Twitter update authentication - swift

I'm making a twitter app on iOS using their api. But they just recently upgraded everything dealing with authentication. Therefore breaking The Swifter library that I am using. My app was working fine before this update. In my apps.twitter.com In the setting section, the first callback url I have is http://MyTweeter ...It wants to me to add another callback, idk why/what so I just added http://google.com. In my app when I call the authentication function, it starts to authenticate and goes to the twitter login page and right after I click the login button it shows me the error in the pic attached below "Safari cannot open the page because the server cannot be found". Does any one have a solution?

So i found the solution. In you app, in the authentication function, your callback url should be something like MyTwitter://success but in apps.twitter.com you have to make it MyTwitter:// without the second part

Related

Facebook Messanger App callback doesn't call my app

I created chatbot for Facebook. I tested in on one fanpage, got business and api permissions verfications from Facebook and I wanted to add the bot to more fanpages. I did it as before, I setted all Webhooks like messages, message_echoes but Facebook doesn't call my app. I'm checking it in debuging tool that shows network traffic to my server.
I tried to remove and add callback, fanpages, but nothing gets change.
The first fanpage still works all fine, but others don't call my bot on any message. Why?
assume you link your app to first fanpage with oauth dialog like this before.
oauth dialog : (See: https://developers.facebook.com/docs/marketing-api/overview/authorization)
https://www.facebook.com/v12.0/dialog/oauth
?client_id=<YOUR_APP_ID>
&redirect_uri=<YOUR_URL>
&scope=pages_messaging
when linking another fanpage with oauth dialog,
should click that edit settings button:
choose another fanpage:
now you receive webhooks from other fanpages.
So, problem was in my code. I was checking if request was sent using Symfony profiler. The problem was, it didn't save request if the process was stopped. And it was. I had "die" in some trycatch...

How to get data from Cordova's in-App Browser

I'm working on authentication for an Ionic 4 app. I'm using the in app browser plugin to login. After successful login an access token is sent back to the client. I can't figure out how to get the token from the In-App Browser to the app.
You can use an event listener such as :
this.browser.on('loadstart').subscribe(event => { this.checkForToken(event); })
Where checkForToken can look at your "event.url" and parse the token to be stored to localStorage or some other method to be used to login with once the in-app browser is closed.
Using events to listen for load start and stop was an awesome idea. I was, however, facing another issue. Google doesn't allow sign in using the In-App Browser and I really needed that. After asking around and looking at similar past issues I came across a Cordova plugin called BrowserTab. This was awesome as it's an instance/Custom Tab from chrome so it worked fine with google sign in. Another problem came up. You can't inject Javascript into BrowserTab and there was no way to programmatically close it once done. I looked around some more and that's when Deeplinks came to mind. I used the Deeplinks plugin and passed my access token as a parameter. When the user logs in, the BrowserTab redirects to a Custom URL scheme link for my app with the access token in the URL. Now it works perfectly. I've read somewhere that IOS is getting rid of Custom URL Scheme links. Luckily, it still has support for Universal App Links

Issues using Spring Social Quickstart example

I'm trying to use the Spring Social Quickstart app from the Github repo, https://github.com/spring-projects/spring-social-samples. I updated the versions in build.gradle and ran the app.
A simple page was display with a button, "Sign in with Facebook". If I'm not already signed in with Facebook, I get an FB error page telling me to sign in (seems a bit contradictory!). If I sign-in and run the app, I get an error dialog saying:
URL Blocked: This redirect failed because the redirect URI is not
whitelisted in the app's Client OAuth Settings. Make sure Client and
Web OAuth Login are on and add all your app domains as Valid OAuth
Redirect URIs.
When I click on the "Okay" button, another error message pops up saying it "Can't Load URL" (there's more to it, but I figure the first error is the key one). This error keeps popping up every time I hit the "Okay" button.
As far as I know, everything on the Facebook app is configured correctly, but not 100% sure.
One other thing, when the "Sign in ..." button is pushed, the URL opened shows that it's trying to connect using v2.5 of the FB API. Don't know where this is being set, but it is 3 versions behind.
Going through the Spring docs as well, but there are a lot of moving pieces to work through. Any help would be appreciated.
Thanks.
So I discovered after looking more closely at the URL when the error comes up that I had the redirect URL incorrect. Once I corrected that, I was able to login and get the extra permission added.
I'd still like to know about where the version for the API is set.

When I use the facebook javascript SDK for authentication it fails on mobile phones and ipad

Javascript authentication works great on browsers but once I use the website on mobile, I always get this error on the login popup.
Sorry, the application you are using is misconfigured for Facebook integration. Please download the newest version of the application.
Instead of showing the usual login popup, it goes to m.facebook.com and it produces this error. Whats interesting is clicking on the spanish link, makes it work again.
--EDIT--
After doing some research and tinkering, ive nailed it down to this:
<fb:login-button registration-url="http://www.example.com/page#register" onlogin="authenticate.facebookLoginCallBack()"></fb:login-button>
Its possible the pound sign blows it up. I need the pound sign because i dont want to redirect off the page,instead i want to trigger a js registration popup.
My guess is that the # gets into the redirect-url, and then must somehow get transformed again on its way to getting redirect to m.facebook.com and that makes it fail there.
--EDIT--
I thought about redoing the flow by creating my own button and calling FB.login, but there is no way to tell the API to stop at login, and load my own registration. The problem is summed up here Registration flow using FB.login
Realistically it seems we are only provided with one option here:
https://developers.facebook.com/docs/plugins/registration/
Login + Registration Flows
and it doesnt work in my situtation
VISUALS
Typically the user clicks on this button
Then they see this dialog. (Notice it says www.facebook.com in the url)
But they see this dialog on mobile. (This is loading from m.facebook.com)

Phonegap facebook API

I have installed the facebook API in phonegap but i have hard time making it work see link .The index.html file in the exemple folder has a login button that once taped opens the native facebook application on my device requiring email and password. After having authenticated me, it takes me back succesfully to my app.
Whenever i tap on the "getsession" button for exemple it shows me an alert saying "undefined". I want to know how to get the access token that is given right after the authentication process within my app and everything related to the session so i can perform other tasks?
Thank you