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

Not getting notification for email filter #2258

Open
mnk98 opened this issue Feb 20, 2025 · 2 comments
Open

Not getting notification for email filter #2258

mnk98 opened this issue Feb 20, 2025 · 2 comments

Comments

@mnk98
Copy link

mnk98 commented Feb 20, 2025

I was using android OneSignal SDK 4.8.10 and was setting user email like

OneSignal.setEmail(
               "[email protected],
                object : EmailUpdateHandler {
                    override fun onSuccess() {
                        Timber.i("Email sent to OneSignal successfully")
                    }
                    override fun onFailure(error: EmailUpdateError) {
                        Timber.e("Onesignal sent email error " + error.message)
                    }
                }
            )

Now I am upgrading my OneSignal SDK to 5.1.28 which is the latest and setting user email like
OneSignal.User.addEmail("[email protected])

I am using API to send push notifications based on the email filter below

{
  "app_id": "{{APP_ID}}",
  "contents": {"en": "Test Notification"},
  "filters": [
      {
        "field": "email",
        "value": "[email protected]"
      }
    ]
}

I get a notification in my Android device when the build is created via the old version which is 4.8.10
But when I run build from the updated version i.e 5.1.28, I do not get any notification

I want to send notifications based on email
Any help

@nan-li
Copy link
Contributor

nan-li commented Mar 3, 2025

Hi @mnk98 thanks for reaching out.

Did you confirm the user is created successfully when using 5.1.28 and the email is successfully attached? You can check the dashboard and the logs in Android Studio when you add the email.

@mnk98
Copy link
Author

mnk98 commented Mar 4, 2025

Yes, I checked the Onesignal dashboard and I see the user has an email attached to that subscriber.
But I notice one thing
It creates 2 users with the same player Onesignal ID where one user has email and another one does not
and one shows the device Google Pixel 6 which does not have email and another one shows email instead of device

Image

Image

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

2 participants