Thanks for the reply. I thought about it before but didn’t know how to set it up.
Now I tried to use the example you gave me but it fails me, the promise fails due to an undefined value. Do I need to use await async?
Error: Uncaught (in promise): TypeError: window.cordova.exec is not a function. (In ‘window.cordova.exec(deviceStateCallback, function(){}, “OneSignalPush”, “getDeviceState”, )’, ‘window.cordova.exec’ is undefined)
The current ionic documentation (and capacitor and onesignal) is an abomination when it comes to using onesignal with ionic 6. This comes mainly from the fact that at first the @awesome package added types for onesignal 1 and 2, but onesignal@3 added their own TS support.
I finally got it working by looking at one of the onesignal examples, Ill try to update the documentation as far as I can next week to make sure nobody has to waste their time on it.
Hi Webrow, I am having the same issue. I can’t get the onesignal to work with ionic 6 in capacitor. Can you help to show how you did get it working? Thank you very much.
Sorry for this late reply, I have notifications turned off. Can you describe your situation?
ionic version, platform, cordova, capacitor, which version of capacitor, etc etc