Adding a package folder to the cordova plugin

I added the package to my plugin, indicating its path

<resource-file src="src/ios/MyDataModel.bundle" />

When I install my plugin, this kit is copied to a folder Resourcesthat I think is expected.

Inside the plugin, I am trying to get the path to this package by doing

NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"MyDataModel" ofType:@"bundle"];

However, the bundlePath parameter is set to nil, and I cannot understand why. What am I missing here?

+4
source share

Source: https://habr.com/ru/post/1531498/


All Articles