Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addEventListener('ids', this.onIds) does not work (or I misunderstand something ) #280

Closed
Kacoze opened this issue Jul 6, 2017 · 11 comments

Comments

@Kacoze
Copy link

Kacoze commented Jul 6, 2017

Ok, so I configured onesignal with rn as is in readme, and it works. Notifications are coming. However I also need to get device (player) id, so it can be handled by my api. As I understood, I should use:

componentWillMount() {
    OneSignal.addEventListener('ids', this.onIds);
}

onIds(device) {
    console.log('Device info: ', device);
}

However, it never triggers. Am I doing sth wrong? How can I get device ids of current user?

@Kacoze Kacoze closed this as completed Jul 6, 2017
@ghost
Copy link

ghost commented Jul 23, 2017

@Kacoze Feedbacks are appreciated if you managed to resolve your issue.

@atasmohammadi
Copy link

any solutions for this issue? facing the same.

@arma7x
Copy link

arma7x commented Aug 29, 2017

i'm also facing this issues, device can received push notification but can't get ids.
Edited: fixed by add OneSignal.configure() after addEventListener

@deepakverma4
Copy link

+1

@tranvannhat
Copy link

Thanks @arma7x <3

@yaseralimardany
Copy link

come on. Its work. why documentation of one signal was weak!!

@duytq94
Copy link

duytq94 commented Aug 1, 2018

In previous version, we don't need add that line, but don't know why they don't update the docs!!!

@kovalyovkirill
Copy link

Thanks for solution. Just found in docs:
Please note that calling OneSignal.configure() causes the ids event to fire.

@mohanasundaramn
Copy link

@arma7x Fixed my issue, Thank you.

@VictorPulzz
Copy link

Not fix for me

@Luckygirlllll
Copy link

I'm getting an error RNOneSignal.configure is not a function after updating OneSignal to the latest version, was it deprecated/ removed in the latest version?
#844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests