You need to wait for the plugins to finish loading by listening to the “deviceready” event from Cordova before using any plugin. In Ionic Angular you can do this easily with the platform.ready() promise.
But I strongly recommend you to use OneSignal from Ionic Native, since it’s easier to deal with plugins and you’ll get type autocompletion and better error messages.