NativeScript / nativescript-camera

NativeScript plugin to empower using device camera.
Apache License 2.0
92 stars 47 forks source link

Error in "index.d.td" for function "requestPermissions" #162

Closed lord-saumagen closed 5 years ago

lord-saumagen commented 5 years ago

Dear Ladies and Gentlemen,

it came to my attention that the definition of the "requestPermission" function is erroneous. The function is implemented as an asynchronous function for android as well as for IOS. See the pictures below.

image

image

The android implementation calls a function which returns a promise. The IOS implementation constructs a promise in the function implementation.

Unfortunately the type definition doesn't show that the function returns a promise. That made me believe the function executes synchronously, which lead to some strange behaviors in my program.

image

It would be very nice if you could update the "index.d.ts" file.

Kind regards, Lord Saumagen.

tgpetrov commented 5 years ago

Hi @lord-saumagen, Thank you for your feedback. The change is made and will be included in the next release of the plugin.