{"id":21851892,"url":"https://github.com/ulbora/nativescript-hosted-toast","last_synced_at":"2026-04-11T06:01:21.199Z","repository":{"id":57308550,"uuid":"60046928","full_name":"Ulbora/nativescript-hosted-toast","owner":"Ulbora","description":"A Nativescript Plugin to access Android Toast on a device from a hosted Angular 2 application","archived":false,"fork":false,"pushed_at":"2016-05-31T01:49:39.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-18T03:05:27.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Ulbora.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-05-31T00:39:04.000Z","updated_at":"2016-05-31T00:42:04.000Z","dependencies_parsed_at":"2022-08-29T02:41:42.464Z","dependency_job_id":null,"html_url":"https://github.com/Ulbora/nativescript-hosted-toast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ulbora/nativescript-hosted-toast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fnativescript-hosted-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fnativescript-hosted-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fnativescript-hosted-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fnativescript-hosted-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ulbora","download_url":"https://codeload.github.com/Ulbora/nativescript-hosted-toast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fnativescript-hosted-toast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260477922,"owners_count":23015064,"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-28T01:12:07.710Z","updated_at":"2025-12-30T21:53:08.242Z","avatar_url":"https://github.com/Ulbora.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nativescript Hosted Toast Plugin\nThis a Nativescript Plugin that lets you make toast from a hosted Angular 2 application.\n\n## Installation\n\n```\ntns plugin add nativescript-hosted-toast\n\n```\n\n## Usage\n\nCreate a wrapper application with the following code and a Navivescript WebView.\nSee the following project as an example:\nhttps://github.com/Ulbora/NSWrapper\n\n```\nvar application = require(\"application\");\nvar context = application.android.context;\nfunction pageLoaded(args) {\n    var page = args.object;   \n    var web = page.getViewById(\"webView\"); \n    var androidSettings = web.android.getSettings();\n    androidSettings.setJavaScriptEnabled(true);    \n    var hostedToast = new com.ulbora.hosted.toast.HostedToast(context);    \n    web.android.addJavascriptInterface(hostedToast, 'HostedToast');\n    web.url = \"http://someURLWhereAngular2AppIsHosted\";\n}\nexports.pageLoaded = pageLoaded;\n\n```\n\nInside the Angular 2 hosted application, write the code where you want to access device information.\nSee the following project as an example:\nhttps://github.com/KenWilliamson/Angular2HostedMobileApp\n\nComponent code:\n```\ndeviceReady: boolean;\n\n ngOnInit() {        \n        try {\n            if (HostedToast) {\n                this.deviceReady = true;\n            }\n        } catch (err) {\n        }\n    }\n\n\n showToast() {\n        try {\n            HostedToast.showToast(\"Toast is working in a hosted world.\");            \n        } catch (err) {\n        }\n    }\n\n```\n\nTemplate Code:\n```\n\u003cdiv *ngIf=\"deviceReady\"\u003e\n    \u003cdiv\u003e \u003cb\u003eYour Toast\u003c/b\u003e: \u003cspan (click)=\"showToast()\" class=\"glyphicon glyphicon-phone\"\u003e\u003c/span\u003e\u003c/div\u003e        \n\u003c/div\u003e\n\n```\n\n## Available Methods\n#### HostedToast.showToast(\"some message\")\nSends a toast message to the device\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbora%2Fnativescript-hosted-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulbora%2Fnativescript-hosted-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbora%2Fnativescript-hosted-toast/lists"}