Not getting notification for email filter
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
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.
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
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
Hi @mnk98, this view you are showing looks like a "subscription view" rather than a "user view". It shows the 2 subscriptions for the user with onesignal ID of "82de48f2...." One subscription is the email subscription and one subscription is an Android push subscription. Since both subscriptions are for the same user, the activity timeline is the same. Does that clarify this?