In my android project some android devices(eg: one plus2) not getting push notification some times.All sdk set up for android is as per documentation and earlier it was able receive notifications.It is very sure that onPushReceived function of AirshipReceiver is called as per our logs but no notification pop up received in device.We have not implemented any custom notification from our app.
Please find the attached screen shot for reference one of device channel id from UA dash board which is not received notification pop up.
There are a couple of things to make sure of when testing notifications on Android devices.
First and foremost is to make sure that you're opted-in to receive pushes on that device. If, for any reason, that device is opted-out, that device will still receive notifications, however the notification will not show to the user.
Second, make sure that you don't have Advanced Optimization turned on for your device. I know for OnePlus devices that there is an Advanced Optimization setting that restricts background activity of apps more aggressively to improve battery life. Certain apps may not receive notifications until they are reopened.
Lastly, in order to troubleshoot this effectively, I would recommend implementing the Sample app, and see if the behavior of your notifications differ from your app. If so, you may look at your implementation of the SDK vs. the Sample app and see if there are any changes to be made.
Thanks for your comments. I have checked that the device seems not been opted-out . The problem is the device receives notifications but there is no consistency.When we sent notification through the UA API with device token it receives well and at the same time when we sent from UA dash board by targeting only the same device token its not receiving.
My questing is if some thing is wrong in sdk implementation why the device receiving messages (from API) some times with the same application.Please suggest where ever i can look/debug to resolve this.
We are updating channel id of the device to our server (from where we push notifications sent) from application on every app launch.
when we debug with the same device with development credentials it is working fine from either UA API or UA dash board.
You mentioned you are making API sends to the Device Token. Does the behavior change at all if you instead focus on sending to the Urban Airship Channel ID?
Also, is there a Device Token you're able to confirm was not able to receive a push through the dashboard, but able to receive through the API?
The push API which is sent as an individual push for particular device(especially one plus) is able receive notifications.When sent push to all devices at a time few devices failed to receive notification.
This issue is happening in production environment.We are wondering the devices are receiving notification when it sent to particular device with consistency.But the same fails when send push to all devices via API.The API written to send push to all ios and android devices is able to send notification for all ios devices but not all android devices,only few android devices receiving.
Do you happen to have your App Key handy? I'd like to take a look at your app and see if I can find any information as to what's happening.
app key used in application is "HimYZ9-pQpS43XaWj-e4xA".
Just want to know ,In application is channel ID from UA is same for all the time until and unless application is un installed? and when it will be changed?
Generally for Android devices, the Channel Id will remain the same unless the user uninstalls the app from their device. If that user reinstalls the app on their device, they will receive a new Channel Id.
Are you perhaps sending to Channel Ids that are no longer valid?
No, Since the app is in production the users will just updated their app so the channel ID will remains same.We are just facing issues with some of users unable to receive push notifications consistently when only push sends to all devices through API or from UA dashboard.
Following are some of device tokens which we are facing issues.
Notifications are receiving from API when its to specific device.and same devices not receiving when we sent push to all devices or to specific from dash board.
I'm seeing the Channel ID e6bbab3e-7b3a-46bf-8b21-fabb477dd964 as opted-out, so that would be the reason why nothing is sent to that device.
As for the testing of pushes via the API vs. the dashboard, can you confirm which URL you are using when sending a push via the dashboard?
The above user re installed his app now his channel ID is
f90ae205-769e-4187-8820-b700a33c0371 still this user not receiving notifications.
and follwing user also facing same issue,he was able to receive notification some times but not always
we are using below url for sending notification from dash board.
Can you check to see if there is any logic in your app that would set that users opt-in status to "false"?
When you do a Device Lookup on that channel, it now shows as opted-out, so it cannot receive push anymore.
Is there some logic in your app that would set UserNotificationsEnabled to false? If so, in what scenarios would that occur?
We have set setUserNotificationsEnabled to false and implemented custom notification in application for every scenario since there is in consistency in default notification .
We are very sure that we never write any logic for setting users opt-in status to "false"? in application.
When we set UsernotificationEnable false and implemented custom notification from that time in device look up opt in coming as RED.
The above device token is showing as Opted-in ,will the does n't receive push?All android devices from this app showing as same in device look up and able to receive push.Only most of one plus devices facing inconsistency.
"We have set setUserNotificationsEnabled to false..."
Just to clarify, do you mean you've set UserNotificationsEnabled to true, correct?
You absolutely need to set UserNotificationsEnabled to true in order for the app to be opted-in. That flag is what controls the opt-in status.
If we set setUserNotificationsEnabled to true the notification popup will come from the UA sdk. Since we have implemented custom notification in app level we make it false.
If we set setUserNotificationsEnabled to true then there will be 2 push notification popups will come one is from default popup from UA sdk and another one is custom notification popup from application is n't true? If so how can we implement custom notification popup from app level.
With this implementation we are able get pushes in most of devices from UA. Our problem is so many users reporting they are not receiving pushes even they are in latest version of our app.
Android does not have a notification pop-up like iOS does, so I'm not certain where you're getting this pop-up from?
Can you elaborate or show what pop-up you're referring to?
Additionally, you absolutely need to set setUserNotificationEnabled to true in order to allow the SDK to handle pushes correctly in the SDK, regardless of whether or not you're using a custom notification factory. Failure to do so will result in the situation you're running into right now.
i mean to say popup is noting but push notification in status bar of device once message pushed from dash board.
As per your suggestion if i set setUserNotificationEnabled to true then how can i implement custom notification factory will that does n't result two notifications.
According to you i must need to set setUserNotificationEnabled to true ,since i have set it false in my application how its able to receive pushes from notification factory.
As per your suggestion Once we set setUserNotificationEnabled to true how we need to handle custom notification in onPushReceived method.
Before I answer that question, I might ask what use case you're trying to resolve by using the Custom Notification Factory?
That is, does the Default Notification Factory that is provided with the SDK not resolve some use case you are trying to solve? If so, in what way?
This will help me better understand what you're trying to accomplish so we can get you on the right path.
We just implemented custom notification since we are unable to figure it out why default factory unable to receive.And more over some users reported to us that they received push as per the notification details screen in side application but they did n't see any notification pop up in status bar of the device.
We just choose custom notification instead of default notification by assuming it may help us to resolve the issue.But both the way implementations giving us same result.We are expecting some technical solution that you might be aware this kind of problems with your customers.We are hoping the cause for this issues are because of the particular device optimization settings ,those may clear the notifications when they received.
In one plus devices due to doze mode/battery optimization settings the notifications are automatically cleared we assuming it might be the issue.
From long path of this conversation ,still we not concluded anything to resolve this issue from our end or either you.We request you conclude the cause for the issue/problem by considering the below device tokens since they always facing inconsistency while receiving push notification.
Moving forward, I would use the DefaultNotification Factory, rather than a custom one, as this uses the default settings for showing the notification to the user.
As far as One Plus devices, make sure that battery optimizations are turned OFF. If that is turned on, that allows the OS to effectively kill the app. Once the app is killed, it can no longer receive push until that user has opened the app again. This is not ideal for users if they wish to receive notifications from that app.
Additionally, do you happen to know if there are any additional implementation details about your app that may be interacting with notifications on Android? That is, aside from the notification factory, are you handling any notifications in your app yourself, or is everything at this point in time handled by the UA SDK?
we are handling notifications from our app.As you recommended will go with notification default factory instead of custom notification factory by setting setUserNotificationEnables to true.
Sounds good! Let me know if you have any issues with the integration and I will help where I can!