Once I get directed to Facebook, Google, or Twitter for authentication and provide my credentials, then at the point I get redirected, all it displays is a white screen. I want to say that it's not redirecting me back to my application.
Btw, this happens when I run my Ionic app on my Galaxy S5 phone. The redirect works fine when I run it on Chrome in my laptop.
This is my code.
ref.authWithOAuthPopup(provider, function(error, authData) {
if(authData){
$timeout(function(){
$location.path('tab/profile');
}, 1000);
} else {
$ionicPopup.alert({
title: 'Error',
template: 'Try logging in again.'
});
console.log(error);
}
});
The solution is to install the following plugin: org.apache.cordova.inappbrowser.
You can run the following command:
cordova plugin add org.apache.cordova.inappbrowser
Related
I am currently using the WalletConnect Standalone Client within my web application to perform a message signature with the Metamask application.
I implement the signature method as indicated on the documentation.
const message = "Hello World";
const msgParams = [
convertUtf8ToHex(message),
"0xac11ea55101f03ea7a94c1379bc3ab32e65e62d3"];
connector
.signPersonalMessage(msgParams)
.then((result) => {
console.log(result);
})
.catch((error) => {
console.error(error);
});
However, when I select Metamask from the WalletConnect modal, I am redirected to the AppStore on the Metamask page even though the application is installed (last version dated January 25, 2023).
When I click on the "Open" button from the AppStore I can access Metamask and I can make the signature. But after validation of the signature I am not redirected to my application but I am redirected again to the AppStore on the page of Metamask. Note that this behavior is not present on Android
I saw that a discussion on the Metamask git repository was opened about this and that it is notably about deep links.
Is there a way to fix this redirection problem?
Any help is appreciated. Thanks.
UPDATE: I have been able to get the website to redirect, but my electron app is not yet able to intercept that action. Is that possible in development? I have asked that question here.
I'm trying to register a custom protocol with electron. I want it to be a redirect location that a website can use to provide an api key (like myprotocol://example/payload=api-key).
But when the website tries to redirect to my protocol it keeps saying: failed to launch myprotocol://example/payload=key... because the scheme does not have a registered handler. What do I need to do to make this work?
I'm hoping to make this work in production and development.
I've seen discussion here and the comments here. Following along the docs from electron
here, this is what I've tried:
main.js:
const { app, protocol } = require('electron')
app.whenReady().then(() => {
protocol.registerFileProtocol('myprotocol', (request, callback) => {
console.log('It worked! The website is sending this url: ' + request.url)
}, (error) =>{
if (error) console.log('Did not register the protocol')
})
})
redirect uri provided to the website:
'myprotocol://example'
And I have been able to whitelist myprotocol://example at the website.
But, when the website tries to redirect to this protocol, my electron app does not register any activity, and the web inspector on the website shows the error: failed to launch myprotocol://example/payload=key... because the scheme does not have a registered handler.
I have additionally tried other methods, like registerSchemesAsPrivileged and registerHttpProtocol, without success.
Any ideas?
I have a detached app which I recently updated from Expo 31 to Expo 32. In the new version, the Google Sign in has completely changed and I had to redo the code.
The Android version is not working locally (it gives a fail error) but when I upload to the store it works fine. But, the IOS version fail both local and in Store (it crashes the whole app) when I click the Google Login button specifically this line of code await GoogleSignIn.signInAsync();
this is how I try to sign-in
await GoogleSignIn.initAsync({
clientId: clientId,
scopes: ['profile', 'email'],
behavior: 'web'
});
await GoogleSignIn.askForPlayServicesAsync();
result = await GoogleSignIn.signInAsync();
I found my answer here =>
https://stackoverflow.com/a/47290909/1840606
I still don't know why it was not creating the url type for me and I had to add it manually.
I made reactjs project using create-react-app on front-end and python/django on back-end and I deployed it on heroku.
when I open my chrome browser and login on my laptop, It works fine.
but If i try to login on my iphone safari or chrome app, it doesn't work.
I use axios to submit login form data on http post request.
below are my login saga
export function* login({ username, password, history }){
const params = {
url: API_URL + '/token/',
method: 'POST',
data: { username, password }
}
const { request, response } = yield call(api, params)
if(request.status === 400){
yield put(doLoginFail(Object.values(response.data).map(a=>a[0])))
}else{
yield put(doLoginSuccess(username))
yield history.push('/calendar')
}
}
I've looked up my heroku app logs, and there are no logs by login attempt on iphone. (but when I login on my laptop, it shows updated logs.)
So I guess axios doesn't send any request?
I used
- axios 0.18.0
- React 16.4
- Python 3.6.5
- Django 2.0.6
- Node.js 8.11.1
Sorry It was a stupid mistake. I set up wrong url for axios.
It works fine on safari and chrome app.
I am using PhoneGap 2.0 for iOS and trying to get FB JS SDK working. I'm loading the SDK asyncronously using the follow params:
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxx', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
....
I have a Facebook app tied to "localhost". When I test the page using the XCode simulator or when opening up my index.html page in a browser (Firefox, Chrome, etc) from my filesystem, I get:
"An error occurred with [APPNAME]. Please try again later."
If I hit the same file through a local apache instance (localhost:8080/index.html) it works just fine.
I noticed that the URL of the FB popup passes along your domain in the querystring. On localhost:8080, it passes "domain=localhost". But in Xcode and from the filesystem it passes "domain=" and gives the above error each time.
Is there a correct way to either configure the FB app to work in a "domain-less" context, or would you setup the FB.init in a different manner?
Take a look at the Facebook Connect Plugin:
https://github.com/davejohnson/phonegap-plugin-facebook-connect
(Check the branch, cordova-2.0-facebook-ios-3.0, if using with the Facebook SDK 3.0 for iOS)
See if that is what you're looking for. The plugin needs to be updated for the just released Facebook SDK 3.1, but should nonetheless be functional. Only issue is if you're running on iOS6 it will not auth against the native iOS6 credentials without a few changes. It will auth by fast app-switching to FB iOS app or FB web app.