{"id":15193864,"url":"https://github.com/peterstaev/nativescript-azure-mobile-apps","last_synced_at":"2025-10-13T17:10:54.856Z","repository":{"id":57308416,"uuid":"57411530","full_name":"PeterStaev/nativescript-azure-mobile-apps","owner":"PeterStaev","description":":cloud: NativeScript plugin for working with Microsoft Azure Mobile Apps services","archived":false,"fork":false,"pushed_at":"2019-10-31T21:41:33.000Z","size":1986,"stargazers_count":30,"open_issues_count":2,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-17T12:05:49.110Z","etag":null,"topics":["android","authentication","azure","ios","nativescript","notifications"],"latest_commit_sha":null,"homepage":"","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/PeterStaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-29T20:37:00.000Z","updated_at":"2024-05-30T15:58:34.000Z","dependencies_parsed_at":"2022-09-16T02:40:28.672Z","dependency_job_id":null,"html_url":"https://github.com/PeterStaev/nativescript-azure-mobile-apps","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/PeterStaev/nativescript-azure-mobile-apps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2Fnativescript-azure-mobile-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2Fnativescript-azure-mobile-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2Fnativescript-azure-mobile-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2Fnativescript-azure-mobile-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterStaev","download_url":"https://codeload.github.com/PeterStaev/nativescript-azure-mobile-apps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2Fnativescript-azure-mobile-apps/sbom","scorecard":{"id":109443,"data":{"date":"2025-08-11","repo":{"name":"github.com/PeterStaev/nativescript-azure-mobile-apps","commit":"e454c1cb41b8de75484db19fdf817270835e1cf8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"123 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-vvj3-85vf-fgmw","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-7mc5-chhp-fmc3","Warn: Project is vulnerable to: GHSA-cwx2-736x-mf6w","Warn: Project is vulnerable to: GHSA-v39p-96qg-c8rf","Warn: Project is vulnerable to: GHSA-8v63-cqqc-6r2c","Warn: Project is vulnerable to: GHSA-q75g-2496-mxpp","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-4cpg-3vgw-4877","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-gff7-g5r8-mg8m","Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-mgfv-m47x-4wqp","Warn: Project is vulnerable to: GHSA-pgr8-jg6h-8gw6","Warn: Project is vulnerable to: GHSA-6663-c963-2gqg","Warn: Project is vulnerable to: GHSA-5v72-xg48-5rpm","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T11:46:17.505Z","repository_id":57308416,"created_at":"2025-08-15T11:46:17.505Z","updated_at":"2025-08-15T11:46:17.505Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016283,"owners_count":26085827,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["android","authentication","azure","ios","nativescript","notifications"],"created_at":"2024-09-27T22:06:14.670Z","updated_at":"2025-10-13T17:10:54.790Z","avatar_url":"https://github.com/PeterStaev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**This repo only supports NativeScript pre-6.0. The latest version of the plugin supporting NS 6+ is availble as part of [ProPlugins](https://proplugins.org).**\n# NativeScript Azure Mobile Apps plugin\n[![Build Status](https://travis-ci.org/PeterStaev/nativescript-azure-mobile-apps.svg?branch=master)](https://travis-ci.org/PeterStaev/nativescript-azure-mobile-apps)\n[![npm downloads](https://img.shields.io/npm/dm/nativescript-azure-mobile-apps.svg)](https://www.npmjs.com/package/nativescript-azure-mobile-apps)\n[![npm downloads](https://img.shields.io/npm/dt/nativescript-azure-mobile-apps.svg)](https://www.npmjs.com/package/nativescript-azure-mobile-apps)\n[![npm](https://img.shields.io/npm/v/nativescript-azure-mobile-apps.svg)](https://www.npmjs.com/package/nativescript-azure-mobile-apps)\n\nA NativeScript Azure Mobile Apps plugin.\n\n## Installation\nRun the following command from the root of your project:\n\n`tns plugin add nativescript-azure-mobile-apps`\n\nThis command automatically installs the necessary files, as well as stores nativescript-azure-mobile-apps as a dependency in your project's package.json file.\n\n## Configuration\nFor most of the functions the plugin you only need to know the name of your Azure mobile apps portal. The only thing that requires additional configuration is the social sign-in under iOS. For that please follow the steps explained [below](#ios-login-requirements)\n\nStarting with version 2.0, due to updated libraries, Mircososft now reqiures the minimum SDK for Android to be 19. So you need to adjust 2 files in your app:\n1. In the `app/App_Resources/Android/AndroidManifest.xml` you must have `android:minSdkVersion` set to 19 or above. \n2. In the `app/App_Resources/Android/app.gradle` you must ensure that in your `defaultConfig` you have `minSdkVersion` set to the same number as the one you set in the `AndroidManifest.xml` file. So assuming you are setting it to 19, your file should look something like this:\n```groovy\nandroid {  \n  defaultConfig {  \n    generatedDensities = []\n    applicationId = \"......\"\n    minSdkVersion 19\n  }  \n} \n```\n\n## API\n\n### `MobileServiceClient`\n\n#### Static Methods\n* **configureClientAuthAppDelegate(): void**  \nConfigures the iOS authentication delegate. You are required to call this before your applications starts in case you will be using social sign in under iOS!\n\n#### Methods \n* **onstructor(string)**  \nInitialize a new client with the given Azure portal url. \n\n* **getTable(string): MobileServiceTable**  \nGets a reference to the table with the given name.\n\n* **login(AuthenticationProvider, string?): Promise\u003cMobileServiceUser\u003e**  \nPerforms a social sign in with the given provider and url scheme. \n\n* **loginFromCache(): boolean**  \nTries to login the user from a previously cached authentication. Returns `true` if successful. \n\n#### Properties \n* **user** - *MobileServiceUser*  \nReturns the currently social signed in user.\n\n* **push** - *MobileServicePush*\nReturns a `MobileServicePush` object which you can use to work with push notifications. \n\n### `MobileServicePush`\n\n#### Methods\n* **register(string): Promise**  \nRegisters the given native push token for push notifications with Azure. \n\n* **registerWithTemplate(string, string, string): Promise**  \nRegisters the given native push token, template name and template for push notifications with Azure. For more information about templates see the usage [below](#register-with-a-template). \n\n* **registerWithTags(string, string[]): Promise**  \nRegisters the given native push token for push notifications with Azure and associates the given tags with the device installation. You can read more about tags [here](https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-tags-segment-push-message).\n\n* **registerWithTagsAndTemplate(string, string[], string, string): Promise**  \nThis combines the above 2 methods, so you can register both with a template and tags. \n\n* **unregister(): Promise**  \nUnregisters the device from Azure push notifications. \n\n#### Properties \n* **installationId** - *string*\nReturns the `installationId` of the device what is registered with Azure's Notification Hubs. This is usefull, for example, in case you need custom tags and you need to call your backend to add the tags.\n\n### `MobileServiceUser`\n\n#### Static Methods\n* **clearCachedAuthenticationInfo(): void**  \nClears the previously cached authentication info. \n\n* **getFromCache():MobileServiceUser**  \nReturns the previously cached user. \n\n#### Methods\n* **getProviderCredentials(): Promise\u003cProviderCredentials\u003e**  \nReturns various details about the current user (for example surname, given name, user id, claims, etc.).\n\n#### Properties\n* **userId** - *string*  \nGets the user id for this user. \n\n* **authenticationToken** - *string*  \nGets the OAuth token for this user. \n\n### `MobileServiceTable`\n\n#### Methods\n* **read(): Promise\u003cArray\u003cT\u003e\u003e**  \nReturns all records in the table. \n\n* **insert(T): Promise\u003cT\u003e**  \nAdds the given item to the table. Returns thie updated item (for example with id assigned).\n\n* **update(T): Promise\u003cT\u003e**  \nUpdates a given item in the table. Returns the updated item. \n\n* **deleteById(number|string): Promise**  \nDeletes the item with the given id from the table. \n\n* **deleteItem(T): Promise**  \nDeletes the given item from the table. \n\n* **where(): MobileServiceQuery**  \nReturns a query object which you can use to filter, order and page through the data in the table. \n\n### `MobileServiceQuery`\nThe query object provies a very easy to use chainable interface to filter, order and page through the data inside a table. \n\n#### Methods\n* **field(string): this**  \nSpecifies that we will be filtering by the given field. After this you can apply one of the filtering operations. \n\n* **eq(string|number|boolean|Date): this**  \nFilters the table by a previously specified `field` so that its value equals the given value.\n\n* **ne(string|number|boolean|Date): this**  \nFilters the table by a previously specified `field` so that its value is different than the given value.\n\n* **gt(string|number||Date): this**  \nFilters the table by a previously specified `field` so that its value is greater than the given value.\n\n* **ge(string|number||Date): this**  \nFilters the table by a previously specified `field` so that its value is greater than or equal to the given value.\n\n* **lt(number||Date): this**  \nFilters the table by a previously specified `field` so that its value is lower than the given value.\n\n* **le(number||Date): this**  \nFilters the table by a previously specified `field` so that its value is lower than or equal to the given value.\n\n* **startsWith(string, string): this**  \nFilter the table by the given field so that the values start with the given value. \n\n* **endsWith(string, string): this**  \nFilter the table by the given field so that the values end with the given value. \n\n* **and(): this**  \nApplies a logcal `AND` operator after which you can start another filter condition. \n\n* **or(): this**  \nApplies a logcal `OR` operator after which you can start another filter condition. \n\n* **orderBy(string, SortDir): this**  \nOrders the resultset by thegive field and direction. This should be applied after specifying your filters!\n\n* **skip(number): this**  \nSkips the given number of records from the current resultset. This should be applied after all filters and sorting. \n\n* **top(number): this**  \nTakes only the given amount of records from the resultset. This should be applied after all filters and sorting.\n\n* **read(): Promise\u003cArray\u003e**  \nReads and returns the records of the currently filtered, ordered and windowed resultset. \n\n## Usage\nNote that there is no difference in using the plugin in Angular NativeScript apps, so the usage below is valid for Angular apps as well. \n\n### Create a client\n```typescript\nimport { MobileServiceClient } from \"nativescript-azure-mobile-apps/client\";\nvar client = new MobileServiceClient(\"https://\u003cPORTAL_NAME\u003e.azurewebsites.net\");\n```\n### Get a reference to a table\n```typescript\nvar todoItemTable = client.getTable(\"TodoItem\");\n```\n### Get all items in a table\n```typescript\ntodoItemTable.read\u003cTodoItem\u003e().then(function(results) {\n    // results is array of TodoItem-s\n    console.log(results.length);\n    console.log(results[0].id);\n});\n```\n### Add an item to a table\n```typescript\nvar item = new TodoItem();\nitem.text = \"NativeScript Rocks!\";\ntodoItemTable.insert(item).then(function(result) {\n    // result is the inserted item with the id changed\n    console.log(result.id);\n});\n```\n\n### Update an item\n```typescript\nitem.text = \"Changed Text\";\ntodoItemTable.update(item).then(function(result) {\n    // result is the updated item\n    console.log(result);\n});\n```\n### Delete an item\n```typescript\ntodoItemTable.deleteItem(item).then(function() {\n    console.log(\"Deleted!\");\n});\n```\n### Delete an item by ID\n```typescript\ntodoItemTable.deleteById(\"some id\").then(function() {\n    console.log(\"Deleted!\");\n});\n```\n\n### Query table\n```typescript\ntodoItemTable.where().field(\"completed\").eq(true).read().then(function(results) {\n    console.log(\"There are \" + results.length.toString() + \"completed items\");\n});\n```\n\n### Sorting\n```typescript\nimport { SortDir } from \"nativescript-azure-mobile-apps/query\";\ntodoItemTable.where().field(\"completed\").eq(true).orderBy(\"createdAt\", SortDir.Desc).read().then(function(results) {\n    // ...\n});\n```\n\n### Paging\n```typescript\nimport { SortDir } from \"nativescript-azure-mobile-apps/query\";\ntodoItemTable.where().field(\"completed\").eq(true).orderBy(\"createdAt\", SortDir.Asc).skip(2).top(3).read().then(function(results) {\n    // Skips 2 completed tasks and returns the next 3 ordered chronologically by creation. \n});\n```\n\n### User Authentication (Social Sign In)\n\n#### iOS login requirements\nIn versions 1.0.0 and lower login on iOS leveraged an in-app browser. This will be banned so we needed to\nswitch to SafariViewController which is not \"in-app\". So we need to be able to switch back and forth between\nthe external browser. The main benefit is this browser can leverage cookies already set by for instance a Facebook\nlogin, so the user doesn't have to enter his credentials again.\n\nIt's a bit of work, but it's a one time effort and should take you about 5 minutes to complete these steps:\n\n##### Custom URL Scheme\nSwitching to the external browser is not a problem, but switching back requires you to configure a 'Custom URL Scheme'.\nOpen `app/App_Resources/iOS/Info.plist` and add:\n\n```xml\n\u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n\u003carray\u003e\n  \u003cdict\u003e\n    \u003ckey\u003eCFBundleTypeRole\u003c/key\u003e\n    \u003cstring\u003eEditor\u003c/string\u003e\n    \u003ckey\u003eCFBundleURLName\u003c/key\u003e\n    \u003cstring\u003emy.bundle.id\u003c/string\u003e\n    \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n    \u003carray\u003e\n      \u003cstring\u003ex-msauth-tns-azure-sample\u003c/string\u003e\n    \u003c/array\u003e\n  \u003c/dict\u003e\n\u003c/array\u003e\n``` \n\nMake sure the Custom URL Scheme string `x-msauth-tns-azure-sample` above is unique on the device of the user,\nso including your bundle id would be a good start (replace the dots by dashes).\n\nAlso, replace `my.bundle.id` by your bundle id.\n\n##### Add ALLOWED EXTERNAL REDIRECT URLS\nAdd `x-msauth-tns-azure-sample://easyauth.callback` to [the 'ALLOWED EXTERNAL REDIRECT URLS' field in these screenshots](https://github.com/Azure/azure-mobile-apps-ios-client/issues/123#issuecomment-272959238) of your Azure backend.\n\n_Make sure to replace `x-msauth-tns-azure-sample` by your own Custom URL Scheme._\n\n##### App Delegate wiring\nNow that your app can be called from the external party it still can't switch back to the foreground unless\nyou wire up a method in the App Delegate. Don't worry, this plugin takes care of that for you, the only thing\nyou need to do is add this line just before `app.start()` in `app.js` / `app.ts`:\n\n```js\n// add this\nrequire(\"nativescript-azure-mobile-apps/client\").MobileServiceClient.configureClientAuthAppDelegate();\n\n// something like this is already there\napplication.start({ moduleName: \"main-page\" });\n```\n\n##### Passing the URL Scheme to `login`\nNote that calling `login` has changed a bit; you now need to pass a second parameter to this function to use the\nnew login mechanism. Failing to do so will fall back to the deprecated in-app browser authentication method.\nMake sure to replace `x-msauth-tns-azure-sample` by the scheme you configured in `Info.plist` before.\nYou can leave it out if you only target Android.\n\n```typescript\nimport { AuthenticationProvider } from \"nativescript-azure-mobile-apps/user\";\nclient.login(AuthenticationProvider.Google, \"x-msauth-tns-azure-sample\").then((user) =\u003e {  \n    console.log(`Logged In! UserID:${user.userId}`);\n}, (e) =\u003e {\n    console.log(\"Error Logging in!\", e);\n});\n```\n\nOnce authenticated the userId and token are cached so you can login by simply calling:\n\n```typescript\nclient.loginFromCache(); // Will return true if there are cached credentials and will setup the client accordingly\n```\n\nIf you want to get additional information about the user (like  provider token, name, email, profile photo etc.) you can do this by calling `getProviderCredentials()`:\n\n```typescript\nclient.user.getProviderCredentials().then((result) =\u003e {\n    console.log(`Surname: ${result.surname}`);\n    console.log(`Given Name: ${result.givenName}`);\n    console.log(`Name: ${result.name}`);\n});\n```\nNote: Since each provider provides different amount of details (also depends on what you have authorized in the Azure portal), \nif you are looking for some specific information, you should check the `claims` property of the result. \nIt is a dictionary containing all the information that is returned from Azure. \n\nIf you want to remove the cached authentication info you should use:\n\n```typescript\nimport { MobileServiceUser } from \"nativescript-azure-mobile-apps/user\";\nMobileServiceUser.clearCachedAuthenticationInfo();\n```\n\n### Push Notifications\n**NOTE:** In order to work with push notifications you also need to install the `nativescript-plugin-firebase` plugin. \nYou can do this by running the following command:\n```\ntns plugin add nativescript-plugin-firebase\n```\nWhen prompted  answer Yes to use the plugin in Push Only setup (in case you won't be using anything from the Firebase plugin)\nYou can read more on how to use the firebase push only setup [here](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/NON_FIREBASE_MESSAGING.md).\n\n#### Register\nYou need to call the push register with Azure in the `onPushTokenReceivedCallback` by passing the registration token \nreturned by the plugin. \n\n```typescript\nimport { messaging } from \"nativescript-plugin-firebase/messaging\";\n\nmessaging.registerForPushNotifications({\n    onPushTokenReceivedCallback: (token) =\u003e {\n        client.push.register(token)\n            .then(() =\u003e { console.log(\"Azure Register OK!\", client.push.installationId); })\n            .catch((e) =\u003e { console.error(e); });\n    }\n});\n```\n\n#### Register with a template\nIf you want to use a custom template for the notifications, you can use the `registerWithTemplate` method to pass \nyour template name and body.\n\n```typescript\nimport { messaging } from \"nativescript-plugin-firebase/messaging\";\n\nlet pushTemplates = {};\npushTemplates[platform.platformNames.android] = \"{\\\"data\\\":{\\\"message\\\":\\\"$(param)\\\"}}\";\npushTemplates[platform.platformNames.ios] = \"{\\\"aps\\\":{\\\"alert\\\":\\\"$(param)\\\"}}\";\n\nmessaging.registerForPushNotifications({\n    onMessageReceivedCallback: (message) =\u003e {\n        console.log(message);\n    },\n    onPushTokenReceivedCallback: (token) =\u003e {\n        client.push.registerWithTemplate(token, \"MyTemplate\", pushTemplates[platform.device.os])\n            .then(() =\u003e { console.log(\"Azure Register OK!\", client.push.installationId); })\n            .catch((e) =\u003e { console.error(e); });\n    },\n});\n```\n\n#### Unregister\n```typescript\nimport { messaging } from \"nativescript-plugin-firebase/messaging\";\n\nmessaging.unregisterForPushNotifications()\n    .then(() =\u003e {\n        console.log(\"Device Unregister OK!\");\n        client.push.unregister()\n            .then(() =\u003e console.log(\"Azure Unregister OK!\"))\n            .catch((e) =\u003e console.log(e));\n    })\n    .catch((e) =\u003e { console.error(e); });\n```\n\n## Demos\nThis repository includes a plain NativeScript demo. In order to run it execute the following in your shell:\n```shell\n$ git clone https://github.com/peterstaev/nativescript-azure-mobile-apps\n$ cd nativescript-azure-mobile-apps\n$ npm install\n$ npm run demo-ios\n```\nThis will run the plain NativeScript demo project on iOS. If you want to run it on Android simply use the `-android` instead of the `-ios` sufix. \n\n## Donate\n[![Donate](https://img.shields.io/badge/paypal-donate-brightgreen.svg)](https://bit.ly/2AS9QKB)\n\n`bitcoin:14fjysmpwLvSsAskvLASw6ek5XfhTzskHC`\n\n![Donate](https://www.tangrainc.com/qr.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterstaev%2Fnativescript-azure-mobile-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterstaev%2Fnativescript-azure-mobile-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterstaev%2Fnativescript-azure-mobile-apps/lists"}