EddyVerbruggen / nativescript-nfc

:pencil: NativeScript plugin to discover, read, and write NFC tags
MIT License
84 stars 37 forks source link

fix: prepare plugin for NativeScript 6.0.0 release #36

Closed rosen-vladimirov closed 5 years ago

rosen-vladimirov commented 5 years ago

In NativeScript 6.0.0 there's a major refactoring in CLI that will require changes in most of the plugin hooks. The major changes are the hookArgs injected by CLI for each hook - they are changed, so some of the properties used from them, should be taken from different property. The other major change is the injected data - in the function used as hook, you can use any service registered in CLI's bootstrap and CLI will pass it to the hook. Several of the services are now renamed or deleted, so hooks using them should be migrated. Such service is platformsData. The last major change is that some logger methods are deleted (they've been deprecated).

The current PR makes the hooks of this plugin compatible with the both 6.0.0 and old releases of NativeScript.

NOTE: I'm not sure the current hooks are actually required. NativeScript CLI has a logic to support app.entitlements files from both App_Resources and from plugins. During project preparation NativeScript CLI will check all app.entitlements files and merge them in a single file inside platforms/ios.... However, the current after-prepare hook of this plugin will overwrite the file with the content of App_Resources/iOS/app.entitlements file. This will break plugins which have their own app.entitlements files, as they will not be included in the native iOS project.

EddyVerbruggen commented 5 years ago

@rosen-vladimirov Thanks for the PR and I agree with your remarks. I guess this was required at some point but it may no longer be. I'll merge and consider further changes.

TY!