Typeerror: cannot read property 'userid' of undefined onesignal

Hello, i am getting error message of userId is undefined of onesignal in ionic 3 app where plugins are install properly and all parameter in OneSignal.init() method are right. then where is problem?
for getting user id i have used this._oneSignal.getIds().then((id) => { console.log(id.userId)}); but not working.