From 9dc7d58a40ee510abae135a2fe19a17d0a311758 Mon Sep 17 00:00:00 2001 From: Joao Duarte <31930009+joaoduartemariucio@users.noreply.github.com> Date: Mon, 26 Feb 2018 17:13:44 -0300 Subject: [PATCH 1/4] Update plugin.xml --- plugin.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin.xml b/plugin.xml index a5218cb..bbb1fed 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,13 +1,15 @@ - UserDefaults for App Groups - This plugin is used to save and load data to the app groups. It - is used to share data between App and Share Extension. + id="cordova-plugin-appgroupsuserdefaults" version="1.0.0"> + App Groups UserDefault + + This plugin is used to save and load data to the app groups. It + is used to share data between App and Share Extension. + Joschka Schulz Apache 2.0 cordova,device,app groups - https://github.com/protonet/cordova-plugin-nsuserdefaults-for-app-groups + https://github.com/joaoduartemariucio/cordova-plugin-nsuserdefaults-for-app-groups @@ -20,10 +22,8 @@ - - From d1cfd9ef5f12d85d676333e65a6c481bce8b5009 Mon Sep 17 00:00:00 2001 From: Joao Duarte <31930009+joaoduartemariucio@users.noreply.github.com> Date: Mon, 26 Feb 2018 17:19:05 -0300 Subject: [PATCH 2/4] Create package.json --- package.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..8b92517 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "version": "1.0.0", + "name": "cordova-plugin-appgroupsuserdefaults", + "cordova_name": "App Groups UserDefault", + "description": "Compartilhar dados salvos na aplicação", + "license": "Apache 2.0", + "repo": "", + "issue": "", + "author": { + "name": "João Vitor Duarte Mariucio", + "email": "joaovitorduartemariucio@gmail.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/joaoduartemariucio/cordova-plugin-nsuserdefaults-for-app-groups" + }, + "keywords": [ + "ecosystem:cordova", + "cordova-ios", + "ios", + "cordova" + ], + "platforms": [ + "ios" + ], + "engines": [], + "englishdoc": "" +} From ce06c951f436b36a2efaf4a18c64f4b7605fbf1a Mon Sep 17 00:00:00 2001 From: Joao Duarte <31930009+joaoduartemariucio@users.noreply.github.com> Date: Mon, 26 Feb 2018 17:27:46 -0300 Subject: [PATCH 3/4] Update README.md --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 302f1cd..68bf36e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,12 @@ -# NSUserDefaults Plugin for App Groups # -By: Protonet GmbH +## Description -Authors: Joschka Schulz +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 https://github.com/protonet/cordova-plugin-nsuserdefaults-for-app-groups.git` - -## 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. +`cordova plugin add https://github.com/joaoduartemariucio/cordova-plugin-nsuserdefaults-for-app-groups` ## Sample Code @@ -46,3 +39,8 @@ The Plugin is only for iOS. }, function() { // failed }); + + ### Load in Today extention in Swift + + let foo = UserDefaults(suiteName: "group.cats.catsAreAwesome")!.string(forKey: "token") + print(foo) From 5edf3487a16b14646ba522ad2296d6881ff29154 Mon Sep 17 00:00:00 2001 From: Joao Duarte <31930009+joaoduartemariucio@users.noreply.github.com> Date: Mon, 26 Feb 2018 17:30:45 -0300 Subject: [PATCH 4/4] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 68bf36e..7d32c9c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ Use the Cordova CLI and type in the following command: The Plugin is only for iOS. +## Settings AppGroup + +It is necessary to configure the extension of the application as shown in the link below. + +https://developer.salesforce.com/blogs/engineering/2017/02/using-ios-app-extensions-mobile-sdk.html + ### Save in UserDefaults var options = {