capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

[Bug]: With CapacitorJS Storage does not work with IOS Version "@capacitor/ios": "^6.0.0"

Open chaklasiyanikunj opened this issue 9 months ago • 1 comments

Capacitor Version

Not working with "@capacitor/ios": "^6.0.0" working with "@capacitor/ios": "^5.7.1", In Android It's working "@capacitor/android": "^6.0.0",

Other API Details

No response

Platforms Affected

  • [X] iOS
  • [ ] Android
  • [ ] Web

Current Behavior

I used the Preferences below :

 async setUser(data: any) {
        await Preferences.set({
            key: 'MyKey',
            value: JSON.stringify(data)
        });
    }

In Version 6.0.0 It's not able to Store the Key

Expected Behavior

Version 6.0.0 should be able to Store the Key In Version 5.7.1, It's working fine.

Project Reproduction

Angular

Additional Information

Is there any way to change the key assigned to version 6.0.0?

chaklasiyanikunj avatar May 08 '24 07:05 chaklasiyanikunj

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. Please see the Contributing Guide for how to create a Sample App. Thanks! Ionitron 💙

ionitron-bot[bot] avatar May 08 '24 09:05 ionitron-bot[bot]

Works for me on iOS with CapacitorJS 6:

import { Preferences } from '@capacitor/preferences';

await Preferences.set({
    key: 'MyKey',
    value: JSON.stringify({data: 'Hello'})
});

let p = await Preferences.get({key: 'MyKey'})
console.log('p', JSON.parse(p.value))
% npx cap doctor
💊   Capacitor Doctor  💊

Latest Dependencies:

  @capacitor/cli: 6.0.0
  @capacitor/core: 6.0.0
  @capacitor/android: 6.0.0
  @capacitor/ios: 6.0.0

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 6.0.0
  @capacitor/ios: 6.0.0
  @capacitor/core: 6.0.0

[success] iOS looking great! 👌

bluepuma77 avatar May 23 '24 15:05 bluepuma77

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Jun 22 '24 20:06 ionitron-bot[bot]