{"id":19220054,"url":"https://github.com/nativescript-community/preferences","last_synced_at":"2026-02-07T08:03:00.701Z","repository":{"id":94068004,"uuid":"241147014","full_name":"nativescript-community/preferences","owner":"nativescript-community","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-02T15:25:14.000Z","size":3112,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-13T01:11:14.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nativescript-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["farfromrefug"]}},"created_at":"2020-02-17T15:53:05.000Z","updated_at":"2024-12-02T15:25:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"988fc1c9-f8f3-4ea5-b979-02e597d725c5","html_url":"https://github.com/nativescript-community/preferences","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/nativescript-community/preferences","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fpreferences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fpreferences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fpreferences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fpreferences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nativescript-community","download_url":"https://codeload.github.com/nativescript-community/preferences/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fpreferences/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261279386,"owners_count":23134864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T14:33:48.012Z","updated_at":"2026-02-07T08:03:00.621Z","avatar_url":"https://github.com/nativescript-community.png","language":"TypeScript","funding_links":["https://github.com/sponsors/farfromrefug"],"categories":["Plugins"],"sub_categories":["Utility Plugins"],"readme":"\u003c!-- ⚠️ This README has been generated from the file(s) \"blueprint.md\" ⚠️--\u003e[![Twitter Follow][twitter-image]][twitter-url]\n\n[twitter-image]:https://img.shields.io/twitter/follow/stevemcniven.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/stevemcniven\n\n\n\r\n[](#nativescript-communitypreferences)\r\n\r\n# @nativescript-community/preferences\n\nThis plugin allows native preference saving\\loading on iOS and Android\n\n\u003cimg src=\"https://raw.githubusercontent.com/sitefinitysteve/@nativescript-community/preferences/master/images/ios-sample.gif\" width=\"200\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/sitefinitysteve/@nativescript-community/preferences/master/images/android-sample.gif\" width=\"200\" /\u003e\n\n\r\n[](#ios-prerequisites)\r\n\r\n## iOS Prerequisites\n\n* Create iOS Settings.bundle files in App_Resources/iOS [See Demo](https://github.com/sitefinitysteve/@nativescript-community/preferences/tree/master/demo/app/App_Resources/iOS/Settings.bundle)\nor [Apple Developer docs](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html)\n\n\r\n[](#android-prerequisites)\r\n\r\n## Android Prerequisites\n* In App_Resources/Android/xml create [preferences.xml](https://github.com/sitefinitysteve/@nativescript-community/preferences/blob/master/demo/app/App_Resources/Android/xml/preferences.xml)\n* Android [PreferenceScreen docs](https://developer.android.com/reference/android/preference/PreferenceScreen.html)\n\n\r\n[](#installation)\r\n\r\n## Installation\n\nDescribe your plugin installation steps. Ideally it would be something like:\n\n```javascript\ntns plugin add @nativescript-community/preferences\n```\n\n\r\n[](#usage-)\r\n\r\n## Usage \n\n```javascript\n    var prefs = new Preferences();\n\n    //Get existing value\n    prefs.getValue(\"name_preference\");\n\n    //Set value\n    prefs.setValue(\"name_preference\", \"some new text\");\n```\n\n\r\n[](#api)\r\n\r\n## API\n    \n| Property | Default | Description |\n| --- | --- | --- |\n| openSettings(): any; |  | Opens the native settings panes |\n| getValue(key: string): any; |  | Gets the value for the preference |\n| setValue(key: string, value: any): void; |  | Sets the passed value to the preference |\n    \n\r\n[](#license)\r\n\r\n## License\n\nApache License Version 2.0, January 2004\n\n\r\n[](#demos-and-development)\r\n\r\n## Demos and Development\n\n\n### Repo Setup\n\nThe repo uses submodules. If you did not clone with ` --recursive` then you need to call\n```\ngit submodule update --init\n```\n\nThe package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.\n\nTo develop and test:\nif you use `yarn` then run `yarn`\nif you use `pnpm` then run `pnpm i`\n\n**Interactive Menu:**\n\nTo start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.\n\n### Build\n\n```bash\nnpm run build.all\n```\nWARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`\n\n### Demos\n\n```bash\nnpm run demo.[ng|react|svelte|vue].[ios|android]\n\nnpm run demo.svelte.ios # Example\n```\n\nDemo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`\nInstead you work in `demo-snippets/[ng|react|svelte|vue]`\nYou can start from the `install.ts` of each flavor to see how to register new demos \n\n\r\n[](#contributing)\r\n\r\n## Contributing\n\n### Update repo \n\nYou can update the repo files quite easily\n\nFirst update the submodules\n\n```bash\nnpm run update\n```\n\nThen commit the changes\nThen update common files\n\n```bash\nnpm run sync\n```\nThen you can run `yarn|pnpm`, commit changed files if any\n\n### Update readme \n```bash\nnpm run readme\n```\n\n### Update doc \n```bash\nnpm run doc\n```\n\n### Publish\n\nThe publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)\nSimply run \n```shell\nnpm run publish\n```\n\n### modifying submodules\n\nThe repo uses https:// for submodules which means you won't be able to push directly into the submodules.\nOne easy solution is t modify `~/.gitconfig` and add\n```\n[url \"ssh://git@github.com/\"]\n\tpushInsteadOf = https://github.com/\n```\n\r\n[](#questions)\r\n\r\n## Questions\n\nIf you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Fpreferences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript-community%2Fpreferences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Fpreferences/lists"}