{"id":242,"date":"2016-02-21T06:18:06","date_gmt":"2016-02-21T06:18:06","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=242"},"modified":"2016-02-21T06:19:36","modified_gmt":"2016-02-21T06:19:36","slug":"nativescript-tip-for-ios-plugin-authors","status":"publish","type":"post","link":"https:\/\/fluentreports.com\/blog\/?p=242","title":{"rendered":"NativeScript: Tip for iOS Plugin authors"},"content":{"rendered":"<p>One of my friends (<a href=\"https:\/\/twitter.com\/wwwalkerrun\" target=\"_blank\">Nathan<\/a>) was working a plugin and for some reason it wasn't bringing in the metadata on iOS.\u00a0 In fact it acted like the Cocoapod did not exist.<\/p>\n<p>If you attempted to use my suggestions for <a href=\"http:\/\/fluentreports.com\/blog\/?p=227\" target=\"_blank\">iOS Metadata Generation<\/a> then you would see that no meta was generated for that plugin.<\/p>\n<p>Well fast forward a week or so, he just linked me to a <a href=\"https:\/\/github.com\/NativeScript\/NativeScript\/issues\/1192\" target=\"_blank\">bug report<\/a>\u00a0 where another person was having the same issues getting his code to generate the metadata.<\/p>\n<p>I knew about the module.modulemap file; because I have used it in my sqlite plugin compiled plugins were available in NativeScript.\u00a0\u00a0 However, what I didn't know was that the cocoapods won't generate any metadata without having a module.modulemap file.\u00a0\u00a0 Most of the cocoapods already have a module.modulemap file; but you might run into some that don't.<\/p>\n<p>So, if your cocoapod is not generating any metadata; then make sure it has the module.modulemap file.\u00a0 If it doesn't, then just like <a href=\"https:\/\/github.com\/ivanbuhov\" target=\"_blank\">Ivan Buhov<\/a> suggested, I would also highly recommend you turn the cocoapod into a simple NativeScript plugin and add the module.modulemap to the plugin folder platforms\/ios.\u00a0\u00a0 Attempting to manually patch the cocoapod is a major recipe for disaster.<\/p>\n<p>The module.modulemap contents needs to be:<br \/>\n<pre>framework module PLUGIN_NAME {\n\u00a0 umbrella header &quot;PLUGIN_NAME.h&quot;\n\n\u00a0 export *\n\u00a0 module * { export * }\n}<\/pre><br \/>\nOdds are very likely that the PLUGIN_NAME.h file will be the same name as the cocoapod, but you might have to check inside the cocoapod (or look at the docs for the cocoapod) for what the master .h file name should be used.<\/p>\n<p>So, remember no module.modulemap file, no metadata on iOS!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of my friends (Nathan) was working a plugin and for some reason it wasn't bringing in the metadata on iOS.\u00a0 In fact it acted like the Cocoapod did not exist. If you attempted to use my suggestions for iOS Metadata Generation then you would see that no meta was generated for that plugin. Well&hellip; <a class=\"more-link\" href=\"https:\/\/fluentreports.com\/blog\/?p=242\">Continue reading <span class=\"screen-reader-text\">NativeScript: Tip for iOS Plugin authors<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15,51,39],"tags":[54,57,52,53,16,34],"class_list":["post-242","post","type-post","status-publish","format-standard","hentry","category-nativescript","category-plugins","category-tips","tag-n","tag-cocoapods","tag-ios","tag-metadata","tag-nativescript","tag-plugins","entry"],"_links":{"self":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242"}],"version-history":[{"count":5,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions"}],"predecessor-version":[{"id":247,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions\/247"}],"wp:attachment":[{"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}