-1

Here is what I followed:

//To create project

$ tns create MYCocoaPodsApp
$ cd MYCocoaPodsApp
$ tns platform add ios

//To create plugin

cd ..
mkdir my-plugin
cd my-plugin

//Created a package.json file with the following content:

{
  "name": "my-plugin",
  "version": "0.0.1",
  "nativescript": {
    "platforms": {
      "ios": "1.3.0"
    }
  }
}

Created a Podfile which describes the dependency to the library that you want to use. Move it to the platforms/ios folder.

my-plugin/
├── package.json
└── platforms/
    └── ios/
        └── Podfile

//Added custom framework in the Podfiles

'pod 'IQKeyboardManagerSwift', '6.3.0' 

// Installed the plugin in the NativeScript Project

tns plugin add ../my-plugin 

// Build the project

tns build ios

Pod installation success, when I try to import the plugin it is showing following error:

enter image description here

I think I'm missing some steps here. How can I import and use the iOS framework APIs?

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

1

I could be able to figure out the issue.

First Point is no need to import created plugin.

If we create metadata and declarations, that should be enough to access the framework API's directly.

Generating MetaData:

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

Generating Declarations:

Run "TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/tsc" tns build ios"