roblav96 / nativescript-onesignal

A Nativescript plugin that wraps the iOS and Android OneSignal Push Notifications SDK.
https://documentation.onesignal.com/docs/getting-started
Other
24 stars 42 forks source link

Cannot read property 'toLowerCase' of undefined #59

Open FlawaCLV opened 5 years ago

FlawaCLV commented 5 years ago

With NativeScript version 6.0 this error can be fixed with var platform = (hookArgs.platform || (hookArgs.prepareData && hookArgs.prepareData.platform)).toLowerCase(); line 5 of nativescript-onesignal-gradle.js

StackOverflow solution here: https://stackoverflow.com/questions/57853453/nativescript-typeerror-cannot-read-property-tolowercase-of-undefined-afte

FlawaCLV commented 5 years ago

https://github.com/roblav96/nativescript-onesignal/blob/48a24d0324ad7fb69fa0c244ee23f1f975123876/lib/postinstall.js#L22

mfik commented 4 years ago

@roblav96 please merge #61

ejlocop commented 3 years ago

Does anyone here has tried to make it work? when I changed the code in lib/postinstall.js:22, it still didn't work and output the same error.

tried removing and adding the android platform but still didn't work.

markosole commented 3 years ago

Hi guys, not fully relevant to this topic but did you make any updates for NS 7 and make it work there?

Thanks!

Dima2111 commented 1 year ago

go to hooks/after-prepare/nativescript-onesignal-gradle.js

and modify line 5 to : var platform = (hookArgs.platform || (hookArgs.prepareData && hookArgs.prepareData.platform)).toLowerCase();