Skip to content

[Beta] Research and implement embedding Apple Watch App inside NativeScript App. #4541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KristianDD opened this issue Apr 16, 2019 · 2 comments · Fixed by #4568
Closed

[Beta] Research and implement embedding Apple Watch App inside NativeScript App. #4541

KristianDD opened this issue Apr 16, 2019 · 2 comments · Fixed by #4568
Assignees
Milestone

Comments

@KristianDD
Copy link
Contributor

KristianDD commented Apr 16, 2019

Is your feature request related to a problem? Please describe.
Currently there is no way to include an Apple Watch App in your NativeScript application.

Describe the solution you'd like
I'd like to add the watch app and watch app extension code inside App_Resources/iOS and the tooling to integrate them build time inside the iOS app.

Describe alternatives you've considered
No alternatives.

Additional context
None.

Workflow:

  1. Create Single Page App from Xcode.
  2. Add watch app target - File>New>Target>WatchKit App
  3. Add a name to your watch app, for example MyFirstWatchApp
  4. Copy the generated "MyFirstWatchApp" and MyFirstWatchApp Extension to .../apps/MyApp/app/App_Resources/iOS/watchapp/MyFirstWatchApp and .../apps/MyApp/app/App_Resources/iOS/watchextension/MyFirstWatchApp Extension respectively.
  5. Inside the Info.plist of the Watch App replace the value of WKCompanionAppBundleIdentifier with $(WK_APP_BUNDLE_IDENTIFIER).
    6 Inside the Info.plist of the Watch Extension replace the value of WKAppBundleIdentifier with $(WK_APP_BUNDLE_IDENTIFIER).
  6. You can populate the Assets.xcassets of the Watch App and the Watch Extension and add the name of the appiconset to the .../apps/MyApp/app/App_Resources/iOS/watchapp/MyFirstWatchApp/watchapp.json and .../apps/MyApp/app/App_Resources/iOS/watchextension/MyFirstWatchApp Extension/extension.json respectively:
{
    "assetcatalogCompilerAppiconName": "AppIcon"
}
  1. You can modify the WATCHOS_DEPLOYMENT_TARGET of the Watch App by adding the value inside the watchapp.json like this:
{
    "assetcatalogCompilerAppiconName": "AppIcon",
    "targetBuildConfigurationProperties": {
        "WATCHOS_DEPLOYMENT_TARGET": 4.1
    }
}
  1. Run the NativeScript application
@endarova
Copy link
Contributor

known limitation is that Swift projects are not supported in the current version

@KristianDD KristianDD changed the title Research and implement embedding Apple Watch App inside NativeScript App. [Beta] Research and implement embedding Apple Watch App inside NativeScript App. May 15, 2019
@MickL
Copy link

MickL commented Jul 22, 2023

This issue is 4 years old, is Swift now supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants