{"id":21088095,"url":"https://github.com/benedictkhoo/nativescript-google-places-sdk","last_synced_at":"2025-05-16T11:32:23.511Z","repository":{"id":35054693,"uuid":"201185541","full_name":"benedictkhoo/nativescript-google-places-sdk","owner":"benedictkhoo","description":"NativesScript plugin for Google Places SDK","archived":false,"fork":false,"pushed_at":"2023-01-07T08:32:53.000Z","size":5006,"stargazers_count":3,"open_issues_count":32,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T15:45:48.431Z","etag":null,"topics":["android","google-places","ios","mobile","nativescript","plugin"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/benedictkhoo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-08T05:37:56.000Z","updated_at":"2024-05-30T16:39:20.000Z","dependencies_parsed_at":"2023-01-15T12:51:47.108Z","dependency_job_id":null,"html_url":"https://github.com/benedictkhoo/nativescript-google-places-sdk","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedictkhoo%2Fnativescript-google-places-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedictkhoo%2Fnativescript-google-places-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedictkhoo%2Fnativescript-google-places-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedictkhoo%2Fnativescript-google-places-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benedictkhoo","download_url":"https://codeload.github.com/benedictkhoo/nativescript-google-places-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254522197,"owners_count":22085060,"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":["android","google-places","ios","mobile","nativescript","plugin"],"created_at":"2024-11-19T21:14:37.248Z","updated_at":"2025-05-16T11:32:18.500Z","avatar_url":"https://github.com/benedictkhoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativesScript Google Place SDK\n\nA NativesScript plugin for Google Places SDK.\n\nDocumentation:\n* [Places SDK for Android](https://developers.google.com/places/android-sdk/intro)\n* [Places SDK for iOS](https://developers.google.com/places/ios-sdk/intro)\n\n## Requirements\n\nEnable Google Places API if you have not already done so.\n\nConfigure skip library check in tsconfig.json\n\n```\n{\n  \"compilerOptions\": {\n    ...\n    \"skipLibCheck\": true\n    ...\n  }\n}\n```\n\n## Installation\n\n```\ntns plugin add nativescript-google-place-sdk\n```\n\n## Usage\n\n### NativeScript\n\nInitialize the Place SDK\n\napp.ts\n\n```\n...\nPlace.initialize(isAndroid ? 'GOOGLE_PLACE_ANDROID_API_KEY' : 'GOOGLE_PLACE_IOS_API_KEY');\n...\n```\n\nShow the Autocomplete UI\n\nmy-awesome-page.xml\n\n```\n\u003cButton text=\"Search\" tap=\"search()\"\u003e\u003c/Button\u003e\n```\n\nmy-awesome-page.ts\n\n```\nexport function search(): void {\n    PlaceAutocomplete.show()\n    .then(\n        (result) =\u003e {\n            if (result) {\n                console.log('Place Details:', result);\n            }\n        },\n        (err) =\u003e console.error(err)\n    );\n}\n```\n\n### NativeScript + Angular\n\nInitialize the Place SDK\n\napp.component.ts\n\n```\n@Component({\n    moduleId: module.id,\n    selector: 'ns-app',\n    templateUrl: 'app.component.html'\n})\nexport class AppComponent implements OnInit {\n    ngOnInit(): void {\n        Place.initialize(isAndroid ? 'GOOGLE_PLACE_ANDROID_API_KEY' : 'GOOGLE_PLACE_IOS_API_KEY');\n    }\n}\n```\n\nShow the Autocomplete UI\n\nmy-awesome.component.html\n\n```\n\u003cButton [text]=\"Search\" (tap)=\"search()\"\u003e\u003c/Button\u003e\n```\n\nmy-awesome.component.ts\n\n```\n@Component({\n    moduleId: module.id,\n    selector: 'ns-awesome',\n    templateUrl: 'my-awesome.component.html'\n})\nexport class MyAwesomeComponent {\n    search(): void {\n        PlaceAutocomplete.show()\n        .then(\n            (result) =\u003e {\n                if (result) {\n                    console.log('Place Details:', result);\n                }\n            },\n            (err) =\u003e console.error(err)\n        );\n    }\n}\n```\n\n## API\n\n### Place\n\n#### initialize(apiKey)\n\n| Property | Default | Description |\n| --- | --- | --- |\n| apiKey | undefined | Google Place API key |\n\nExample\n\n```\nPlace.initialize('GOOGLE_PLACE_API_KEY');\n```\n\n### Autocomplete\n\n#### show(options)\n\n| Property | Default | Description |\n| --- | --- | --- |\n| fields | undefined | Define the types of field to retrieve. By default will retrieve all types. |\n| ios | undefined | iOS related options |\n| ios.appearance | undefined | iOS appearance options. See [documentation](https://developers.google.com/places/ios-sdk/autocomplete#customize_text_and_background_colors) for more info. |\n| ios.appearance.primaryTextColor | undefined | Primary text color |\n| ios.appearance.primaryTextHighlightColor | undefined | Primary text highlight color |\n| ios.appearance.secondaryTextColor | undefined | Secondary text color |\n| ios.appearance.tableCellBackgroundColor | undefined | Table cell background color |\n| ios.appearance.tableCellSeparatorColor | undefined | Table cell separator color |\n| ios.appearance.tintColor | undefined | Tint color |\n| locationBias.southwest | undefined | Southwest bound |\n| locationBias.northeast | undefined | Northeast bound |\n\n| Field | Data Type | Description |\n| --- | --- | --- |\naddress | string | Address |\nid | string | Id |\nlat_lng | object | Coordinates |\nname | string | Place name |\nphone_number | string | Phone number |\nprice_level | number | Pricing |\nrating | number | Rating |\nuser_ratings_total | number | Total ratings |\nutc_offset_minutes | number | UTC offset in minutes |\nviewport | object | Viewport |\nwebsite_uri | string | URL |\n\nExample\n\n```\nPlaceAutocomplete.show({ fields: ['name'] })\n.then(\n    (result) =\u003e {\n        if (result) {\n            console.log('Place Details:', result);\n        }\n    },\n    (err) =\u003e console.error(err)\n);\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedictkhoo%2Fnativescript-google-places-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenedictkhoo%2Fnativescript-google-places-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedictkhoo%2Fnativescript-google-places-sdk/lists"}