1

I struggling to implement a Captuvo static library as a plugin in NativeScript.

Plugin structure:

nativescript-captuvo-scan
    ├── package.json
    └── platforms
        └── ios
            └── include
                ├── captuvo
                │    ├── Captuvo.h
                │    └── module.modulemap
                │       
                └── libCaptuvoSDK.a

After adding the nativescript-captuvo-scan plugin to my project I am running the following commands in an attempt to expose the library as typescript typings.

$ TNS_DEBUG_METADATA_PATH="$(pwd)/metadata" tns build ios

and

$ TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" tns build ios

Lots of d.ts files are generated in the project but I can't find a file exposing the library.

What am I missing, or where am I going wrong?

Does anyone know of a nativescript-plugin that wraps a static library? I can't seem to find an example out there that doesn't use a Podfile.

3
  • I think I know what's wrong. Trevor and I are emailing on this subject and will update this post once we're happy with the result. Commented Apr 19, 2017 at 8:33
  • Turns out my manager discovered that we need to work with a different scanner that has keyboard wedge capabilities. I am putting a hold on my/our efforts for now. Commented Apr 20, 2017 at 16:34
  • 1
    No problemo! In the meanwhile I figured out what the problem was. I'll share it below as an answer so others may benefit. Commented Apr 20, 2017 at 17:04

1 Answer 1

2

The folder structure is very important, but also the filenames. If you do it exactly like this, then NativeScript will correctly pick up your static iOS library:

folder structure

That CaptuvoSDK.d.ts is just a bonus: I generated TypeScript bindings for the Captuvo SDK by running these commands in the app's root folder:

  • TNS_DEBUG_METADATA_PATH="$(pwd)/metadata" tns build ios
  • TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" tns build ios
Sign up to request clarification or add additional context in comments.

2 Comments

Ahh! Thanks for sharing!
I have faced similar kind of problem and struggling to find the issue. If anyone have some idea pls share. stackoverflow.com/questions/49107273/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.