Code Monkey home page Code Monkey logo

Comments (7)

ggozad avatar ggozad commented on July 26, 2024

Has the plugin been initialized? I am guessing not since you respond natively to the notification...

from cordova-plugin-secure-storage.

Alex-Sessler avatar Alex-Sessler commented on July 26, 2024

Does the plugin even need any initialization on ios? The constructor doesn't seem to do much other than setting the service. And yes, the success callback is executed before the get call is done.
I initialize the storage plugins on device ready and start the bootstrapping once this setup is done.

I've also tested using keychain mode "Always", which worked and also "AfterFirstUnlockThisDeviceOnly", which did not work.

from cordova-plugin-secure-storage.

ggozad avatar ggozad commented on July 26, 2024

All cordova plugins need initialization for the bridge to work.
But since you do things natively, you might have more luck with accessing the keychain natively as well. For iOS we barely use https://github.com/soffes/SSKeychain to do so.

from cordova-plugin-secure-storage.

chrigi avatar chrigi commented on July 26, 2024

@Alex-Sessler wrote that he initializes the plugin after the onDeviceReady event was fired, so Cordova did initialize the plugins. According to your securestorage.js code, there is not further initialization necessary after calling the SecureStorage constructor as you immediately call the success function:

var SecureStorageiOS = function (success, error, service) {
    this.service = service;
    setTimeout(success, 0);
    return this; 
};

We don't try to do anything natively. The Objective-C code above is just to show you how the app is launched when a user clicks the notification.
As stated by @Alex-Sessler the issue is that if there is a notification present and the cordova app is in a terminated state, the app will be launched by clicking on the notification (native code from 1st post) but in this state, we can't access the KeyChain in our cordova app.
Launching the app by clicking on the icon or selecting the notification when the app is paused or running does not have this issue. We are trying to figure out if this is an issue with the Plugin, Cordova or the method how the app is launched by the native code.

from cordova-plugin-secure-storage.

ggozad avatar ggozad commented on July 26, 2024

I see. It wasn't clear to me that the onDeviceReady was fired.
I am not sure why this would happen. In our own product Crypho we do the same thing and can access the keychain just fine.
Would it be possible to create a simple test-case with pinned versions and see if it is reproducable?

from cordova-plugin-secure-storage.

Alex-Sessler avatar Alex-Sessler commented on July 26, 2024

The latest changes (moving the work to threads) fixed this issue for me.

from cordova-plugin-secure-storage.

ggozad avatar ggozad commented on July 26, 2024

awesome :)

from cordova-plugin-secure-storage.

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.