martinkasa / capacitor-secure-storage-plugin

Capacitor plugin for storing string values securly on iOS and Android.
MIT License
155 stars 56 forks source link

iOS SecureStoragePlugin.keys() returns JSON serializable error #32

Closed deepanbansal74 closed 3 years ago

deepanbansal74 commented 3 years ago

Keys method return JSON Serializable Error.

Reason: Return type for KeychainWrapper.allKeys() is Set<String>.

QuickFix: File Name: Plugin/Plugin.swift

Updated Method: (Convert Set to Array)

@objc func keys(_ call: CAPPluginCall) {
        let keys = keychainwrapper.allKeys();
        call.success(["values": Array(keys)])
    }

Project Config

 capacitor-secure-storage-plugin (0.5.0)
 @capacitor/core : 2.4.5

Error Screenshot

image
martinkasa commented 3 years ago

Thank you.