8.6 Released with 🥽 visionOS support and more!
Check it out

If the native API you need is not exposed through @nativescript/core, third party plugins or @nativescript/* plugins), you can add it to your project and access it right away in TypeScript.

  1. Add native code to App_Resources. For example, see

  2. Generate types for the added APIs For iOS types run:

    ns typings ios

    For Android run:

    ns typings android --jar <path to a jar>
    # or
    ns typings android --aar <path to an aar>
  3. Reference the generated types in references.d.ts

  4. You can now code against the platform native APIs (strongly typed). For various examples on how to interact with native APIs in JavaScript/TypeScript, visit the Subclassing, iOS Marshalling and Android Marshalling pages.

Additional Resources