New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordova-ios-plugin-userdefaults

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-ios-plugin-userdefaults

This plugin is used to save and load data to the app groups. It is used to share data between App and Share Extension.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Cordova NSUserDefaults Plugin for App Groups

Description

If you like to share some variables between your main app and an share extension, you need to save your variables in a NSUserDefaults container. The NSUserData container can be shared between your both apps and hold all the data you want to transfer.

Please make sure you add the App Groups in the XCode Project for sharing the container between apps.

Install

cordova plugin add cordova-ios-plugin-userdefaults

Sample Code

The Plugin is only for iOS.

Save in UserDefaults

var options = { key: "foo", value: "bar", suite: "group.com.example" };

window.UserDefaults.save(
  options,
  () => console.log("success"),
  () => console.log("error")
);

Load from UserDefaults

var options = { key: "foo", suite: "group.com.example" };
window.UserDefaults.load(
  options,
  (data) => console.log(data),
  (error) => cosnole.log(error)
);

Keywords

FAQs

Package last updated on 08 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc