Skip to content

Commit

Permalink
OneSignal emalSync hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstantineYurevich committed Feb 11, 2017
1 parent 87942c4 commit ac145f7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/integrations/OneSignal.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,11 @@ class OneSignal extends Integration {
if (event.name === VIEWED_PAGE || event.name === SUBSCRIBED) {
const user = event.user;
if (user && user.email) {
window.OneSignal.push(() => {
window.OneSignal.syncHashedEmail(user.email);
});
window.OneSignal.push(['getRegistrationId', (registrationId) => {
if (registrationId) { // This operation can only be performed after the user is subscribed
window.OneSignal.syncHashedEmail(user.email);
}
}]);
}
}

Expand Down

0 comments on commit ac145f7

Please sign in to comment.