jhintstone
jhintstone

Reputation: 83

How to handle push notifications when the user is not logged in?

I am confused about how to handle notifications in the react-native app if the user is not logged in. I send push notifications via OneSignal to the application but if a user is not logged in I should not send a notification, how can I check user is logged in or not?

Upvotes: 2

Views: 1080

Answers (1)

Tarik
Tarik

Reputation: 597

When logging out, you can try to call OneSignal.removeExternalUser() method. And logging in, OneSignal.setExternalUserId(userId).

Upvotes: 2

Related Questions