{"id":15141733,"url":"https://github.com/nativescript/ns-embed-example","last_synced_at":"2025-04-11T23:20:40.360Z","repository":{"id":247842179,"uuid":"823428014","full_name":"NativeScript/ns-embed-example","owner":"NativeScript","description":"Embed NativeScript screens into platform host (Swift, Objective-C, Kotlin or Java based) projects.","archived":false,"fork":false,"pushed_at":"2024-07-10T20:11:24.000Z","size":875,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T03:15:59.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NativeScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"github":"NativeScript","open_collective":"nativescript"}},"created_at":"2024-07-03T02:50:27.000Z","updated_at":"2025-03-23T21:23:51.000Z","dependencies_parsed_at":"2024-07-10T23:46:19.774Z","dependency_job_id":"46972d7a-4464-4399-b477-76eac90add40","html_url":"https://github.com/NativeScript/ns-embed-example","commit_stats":null,"previous_names":["nativescript/ns-embed-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fns-embed-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fns-embed-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fns-embed-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fns-embed-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NativeScript","download_url":"https://codeload.github.com/NativeScript/ns-embed-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493027,"owners_count":21113184,"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-09-26T09:01:31.297Z","updated_at":"2025-04-11T23:20:40.325Z","avatar_url":"https://github.com/NativeScript.png","language":"TypeScript","funding_links":["https://github.com/sponsors/NativeScript","https://opencollective.com/nativescript"],"categories":[],"sub_categories":[],"readme":"## Embed NativeScript Example\n\n*Note: Requires NativeScript 8.8*\n\n```bash\nnpm install -g nativescript\n```\n\n### host-ios-project\n\nA Swift iOS project which embeds NativeScript screens.\n\n### host-android-project\n\nA Kotlin Android project which embeds NativeScript screens.\n\n### nativescript-project-*\n\n- ng: Angular based NativeScript project.\n- react: React based NativeScript project.\n- solid: Solid based NativeScript project.\n- svelte: Svelte based NativeScript project.\n- vue: Vue based NativeScript project.\n\n## Try it\n\nSee `nativescript-project-`*/`nativescript.config.ts` for the host project path settings the `embed` command uses.\n\n```bash\ncd nativescript-project-{ng|react|solid|svelte|vue}\n\nns embed ios\n\n// or...\n\nns embed android\n```\n\nNow open each respective host project, `host-ios-project` in Xcode and `host-android-project` in Android Studio.\n\n### For iOS:\n\n1. Xcode File \u003e 'Add Package Dependencies...' and type in this URL https://github.com/NativeScript/ios-spm to add the NativeScriptSDK.\n   \n2. Modify `ViewController.swift` to specify the name of the embedded project:\n\n```swift\n@IBAction func openMyNativeScriptApp(_ sender: Any) {\n    // modify the appFolder to point to your NativeScript app\n    // ng: nativescriptprojectng/app\n    // react: nativescriptprojectreact/app\n    // solid: nativescriptprojectsolid/app\n    // svelte: nativescriptprojectsvelte/app\n    // vue: nativescriptprojectvue/app\n    self.setupNativeScript(appFolder: \"nativescriptprojectng/app\")\n}\n```\n\n3. Copy Metadata from `nativescript-project-*/platforms/ios/build/Debug-iphonesimulator/metadata-arm64.bin` to `host-ios-project/nativescriptproject*`\n\nNow build and run.\n\n*Note: You can also change the project name/folder of the NativeScript project by setting `projectName` to any you prefer in `nativescript.config.ts`.*\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fns-embed-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript%2Fns-embed-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fns-embed-example/lists"}