{"id":15305113,"url":"https://github.com/eddyverbruggen/nativescript-appavailability","last_synced_at":"2025-07-06T19:08:04.443Z","repository":{"id":31735749,"uuid":"35301746","full_name":"EddyVerbruggen/nativescript-appavailability","owner":"EddyVerbruggen","description":":mag_right: NativeScript plugin to check whether or not another app is installed on the device","archived":false,"fork":false,"pushed_at":"2020-09-06T08:44:57.000Z","size":18,"stargazers_count":19,"open_issues_count":4,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-08T15:02:57.499Z","etag":null,"topics":["bundle","nativescript","package","urlscheme","whitelist"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.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":"2015-05-08T21:05:03.000Z","updated_at":"2024-05-30T16:05:13.000Z","dependencies_parsed_at":"2022-07-20T06:32:10.737Z","dependency_job_id":null,"html_url":"https://github.com/EddyVerbruggen/nativescript-appavailability","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/EddyVerbruggen/nativescript-appavailability","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-appavailability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-appavailability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-appavailability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-appavailability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/nativescript-appavailability/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-appavailability/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263957820,"owners_count":23535604,"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":["bundle","nativescript","package","urlscheme","whitelist"],"created_at":"2024-10-01T07:59:08.760Z","updated_at":"2025-07-06T19:08:04.426Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeScript AppAvailability\n\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[npm-image]:http://img.shields.io/npm/v/nativescript-appavailability.svg\n[npm-url]:https://npmjs.org/package/nativescript-appavailability\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-appavailability.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\nA plugin to check for availability of other apps on the device.\n\n\u003e ⚠️ Looking for NativeScript 7 compatibilty? Go to [the NativeScript/plugins repo](https://github.com/NativeScript/plugins/tree/master/packages/appavailability).\n\n## Installation\nRun the following command from the root of your project:\n\n```\ntns plugin add nativescript-appavailability\n```\n\n## Usage\n\n\u003e Note that version 1.3.0 added a synchronous version of this method that doesn't return a Promise. Need that? Use `availableSync` instead of `available`. \n\n### TypeScript\n```typescript\nconst isAppAvailable = require(\"nativescript-appavailability\").available;\n\n// examples of what to pass:\n// - for iOS: \"maps://\", \"twitter://\", \"fb://\"\n// - for Android: \"com.facebook.katana\"\nappavailability.available(\"twitter://\").then((avail: boolean) =\u003e {\n  console.log(\"App available? \" + avail);\n})\n```\n\n### TypeScript + Angular\n```typescript\nimport * as appavailability from \"nativescript-appavailability\";\n\n// examples of what to pass:\n// - for iOS: \"maps://\", \"twitter://\", \"fb://\"\n// - for Android: \"com.facebook.katana\"\nappavailability.available(\"twitter://\").then((avail: boolean) =\u003e {\n  console.log(\"App available? \" + avail);\n})\n```\n\n### JavaScript\n\n```js\nvar appAvailability = require(\"nativescript-appavailability\");\n\n// examples of what to pass:\n// - for iOS: \"maps://\", \"twitter://\", \"fb://\"\n// - for Android: \"com.facebook.katana\"\nappAvailability.available(\"com.facebook.katana\").then(function(avail) {\n  console.log(\"App available? \" + avail);\n})\n```\n\n## Opening an app (with web fallback)\nNow that you know whether an app is installed or not, you probably want to launch it.\nHere's a snippet that opens the mobile Twitter app and falls back to the website if it's not installed.\n\n```typescript\nimport { available } from \"nativescript-appavailability\";\nimport { openUrl } from \"tns-core-modules/utils/utils\";\n\nconst twitterScheme = \"twitter://\";\navailable(twitterScheme).then(available =\u003e {\n  if (available) {\n    // open in the app\n    openUrl(twitterScheme + (isIOS ? \"/user?screen_name=\" : \"user?user_id=\") + \"eddyverbruggen\");\n  } else {\n    // open in the default browser\n    openUrl(\"https://twitter.com/eddyverbruggen\");\n  }\n})\n```\n\nAnd a more concise, synchronous way would be:\n\n```typescript\nimport { availableSync } from \"nativescript-appavailability\";\nimport { openUrl } from \"tns-core-modules/utils/utils\";\n\nif (availableSync(\"twitter://\")) {\n  openUrl(\"twitter://\" + (isIOS ? \"/user?screen_name=\" : \"user?user_id=\") + \"eddyverbruggen\");\n} else {\n  openUrl(\"https://twitter.com/eddyverbruggen\");\n}\n```\n\n## iOS whitelisting\nTo get useful results on iOS 9 and up you need to whitelist the URL Scheme\nyou're querying in the application's `.plist`.\n\nLuckily NativeScript made this pretty easy. Just open `app/App_ResourcesiOS/Info.plist`\nand add this if you want to query for both `twitter://` and `fb://`:\n\n```xml\n  \u003ckey\u003eLSApplicationQueriesSchemes\u003c/key\u003e\n  \u003carray\u003e\n    \u003cstring\u003efb\u003c/string\u003e\n    \u003cstring\u003etwitter\u003c/string\u003e\n  \u003c/array\u003e\n```\n\nYou may wonder how one would determine the correct identifier for an app.\n* Android: simply search the Play Store and use the id in the URL. For Twitter this is com.twitter.android because the URL is https://play.google.com/store/apps/details?id=com.twitter.android.\n* iOS: this one is a bit harder but this site should cover most apps you're interested in. When in doubt you can always fire up Safari on your iPhone and type for example 'twitter://' in the address bar, if the app launches you're good.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-appavailability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fnativescript-appavailability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-appavailability/lists"}