diff --git a/README.md b/README.md index 302f1cd..7d32c9c 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@ -# 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` +`cordova plugin add https://github.com/joaoduartemariucio/cordova-plugin-nsuserdefaults-for-app-groups` -## Description +## Sample Code -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. +The Plugin is only for iOS. -Please make sure you add the App Groups in the XCode Project for sharing the container between apps. +## Settings AppGroup -## Sample Code +It is necessary to configure the extension of the application as shown in the link below. -The Plugin is only for iOS. +https://developer.salesforce.com/blogs/engineering/2017/02/using-ios-app-extensions-mobile-sdk.html ### Save in UserDefaults @@ -46,3 +45,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) 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": "" +} 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 @@ - -