Coder Social home page Coder Social logo

Comments (7)

tareqdayya avatar tareqdayya commented on June 2, 2024 2

i'm having this problem with ionic/cordova. Anyone knows how to solve it?

from auth0-cordova.

gregor-srdic avatar gregor-srdic commented on June 2, 2024

I believe this is due to missing "cordova-plugin-safariviewcontroller" plugin, I am not sure if it is available for desktop. For desktop web browser authentication, we are using auth0-js lib only:
let auth0WebClient = new auth0.WebAuth({...})
auth0WebClient.popup.authorize...

from auth0-cordova.

ansien avatar ansien commented on June 2, 2024

@gregor-srdic It works on desktop mode, but when i use Phonegap desktop to test it on Android/iOS it'll result in the error above.

from auth0-cordova.

gregor-srdic avatar gregor-srdic commented on June 2, 2024

I am not well familiar, Phonegap desktop is online build tool? Then is it possible, it does not have the plugin available?

from auth0-cordova.

ansien avatar ansien commented on June 2, 2024

No it doesn't build it. I think that's why the plugin isn't working. It works fine after building. But that makes debugging really hard.

from auth0-cordova.

darkyen avatar darkyen commented on June 2, 2024

Phonegap desktop uses Phonegap serve, you should be able to write a custom client for the phonegap serve's mobile application forking and adding any custom plugins needed (this is the recommended way) https://github.com/phonegap/phonegap-app-developer#adding-custom-plugins.

from auth0-cordova.

joeflack4 avatar joeflack4 commented on June 2, 2024

I'm writing a Cordova app that utilizes auth0 via Auth0Cordova.

I'm using React, so I'm using CreateReactApp to build my Cordova activation and handle development. When running my app using Webpack in the browser and trying to log in, I'm getting this error.

During my debugging session, I can see that it's erroring out here:

function Browser() {
  this.browser = window.SafariViewController;
  this.open = this.open.bind(this);
  this.close = this.close.bind(this);
}

Browser.isAvailable = function (callback) {
  window.SafariViewController.isAvailable(callback);  <----------------
};


Browser.prototype.open = function (url, callback) {
  var options = {
    hidden: false,
    url: url
  };

  this.browser.show(options, function (result) {
    callback(null, result);
  }, function (message) {
    callback(new Error(message));
  });
};

Browser.prototype.close = function () {
  this.browser.hide();
};

module.exports = Browser;

@darkyen Recommends writing a custom plugin, but I don't want to do that. I just want to use auth0 in my app and be able to check that it's working fine in development without building first as suggested by @ansien12 .

Here's a gist of what I'm working with: https://gist.github.com/joeflack4/4b271a33a072ad097150374dfa304a68

from auth0-cordova.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.