alexziskind1 / nativescript-oauth2

Other
85 stars 93 forks source link

Update to work with @nativescript/core@8.2 #183

Closed facetious closed 2 years ago

facetious commented 2 years ago

This access to applicationModule.ios can return undefined.

https://github.com/alexziskind1/nativescript-oauth2/blob/d9f6a1861dcedc4e8d2ad34be8a8ae1bdb5680e8/src/delegate/index.ios.ts#L16

Calling applicationModule.ensureNativeApplication() first resolves the issue.

I'm not sure if adding this call here is the best solution, but it is certainly a workaround that corrects the bug.

alexziskind1 commented 2 years ago

Hi @facetious . I tried adding a check, but seems like the plugin might need an update to 8.2 before that api is available.

facetious commented 2 years ago

@alexziskind1 Good point. I suppose it could just be done with regular javascript check:

if (!!applicationModule.ensureNativeApplication) {
  application.ensureNativeApplication();
}
if (applicationModule.ios.delegate === undefined) {
alexziskind1 commented 2 years ago

Thanks @facetious . Would you mind submitting a PR? (or just add it into the code - you've got the rights :)