Sharing Data Application Hybrid with Native

Usage no npm install needed!

<script type="module">
  import cordovaAppgroupsDates from '';



This plugin helps to share data between a hybrid application and a native extension it is easy and efficient if everything is set up correctly.

Adding the Plugin

Use the Cordova CLI and type in the following command:

cordova plugin add cordova-appgroups-dates

Sample Code

The Plugin is only for iOS.

Settings AppGroup

It is necessary to configure the extension of the application as shown in the link below.

Save in UserDefaults

var options = {
      key: "foo",
      value: "bar",
      suite: "group.cats.catsAreAwesome"};,
  function() {
     // success
  }, function() {
    // failed

Load from UserDefaults

var options = {
      key: "foo",
      suite: "group.cats.catsAreAwesome"};

  function(result) {
   // success
   console.log("Result:", result)
  }, function() {
    // failed

Load in Today extention in Swift

let foo = UserDefaults(suiteName: "group.cats.catsAreAwesome")!.string(forKey: "token")