capacitor
capacitor copied to clipboard
[Bug]: With CapacitorJS Storage does not work with IOS Version "@capacitor/ios": "^6.0.0"
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?
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 💙
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! 👌
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.