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

[HMS] unable to process background notification #1498

Closed
KKChong opened this issue Dec 10, 2021 · 4 comments
Closed

[HMS] unable to process background notification #1498

KKChong opened this issue Dec 10, 2021 · 4 comments

Comments

@KKChong
Copy link

KKChong commented Dec 10, 2021

Description:

rawPayload='{"custom":"{"i":"a39d821c-19d9-47cf-9269-721975e8739e","a":{"foo":"bar"}}","alert":"English Message","title":"English Title","hms.sent_time":"0","hms.ttl":"0"}

the ttl value and sent_time value are 0, The default value should be 259,200 seconds (3 days) instead of 0
but GMS is working as expected value = 259,200

below is my request json:
{
"app_id": "c4709073-4aca-4930-bd9a-1605e65c8531",
"include_player_ids": ["373d07ca-44d9-4b8b-8fa7-66b3920c462c"],
"huawei_msg_type": "data",
"data": {"foo": "bar"},
"headings": {"en": "English Title"},
"contents": {"en": "English Message"}
}

Environment
target SDK = 30
OneSignal SDK = 4.6.3
Huawei Push SDK = 6.1.0.300

@KKChong KKChong changed the title Huawei Phone Unable to process background notification [HMS] unable to process background notification Dec 10, 2021
@jkasten2
Copy link
Member

jkasten2 commented Dec 13, 2021

@KKChong Thanks for reporting. If you manually set a TTL (can you test via the dashboard AND the Notification Create REST API) does it correctly show it in the hms.ttl field on the device?

  • This will narrow the issue down if it is a defaulting issue or a payload assigning issue.

On hms.sent_time, it seems the OneSignal backend does not currently add this value to the payload, however it should be informational only.

@KKChong
Copy link
Author

KKChong commented Dec 14, 2021

Hi @jkasten2 , i have tried to manually set ttl to 2419200, but still got the hms.ttl = 0 as below:

Saving Notification job: OSNotificationGenerationJob{jsonPayload={"custom":"{"i":"95ac3b4e-a75f-4f13-a1c1-72b5d13d880c","a":{"foo":"bar"}}","alert":"English Message","title":"English Title","hms.sent_time":"0","hms.ttl":"0"}, isRestoring=false, shownTimeStamp=1639448521, overriddenBodyFromExtender=null, overriddenTitleFromExtender=null, overriddenSound=null, overriddenFlags=null, orgFlags=null, orgSound=null, notification=OSNotification{notificationExtender=null, groupedNotifications=null, androidNotificationId=-1, notificationId='95ac3b4e-a75f-4f13-a1c1-72b5d13d880c', templateName='', templateId='', title='English Title', body='English Message', additionalData={"foo":"bar"}, smallIcon='null', largeIcon='null', bigPicture='null', smallIconAccentColor='null', launchURL='null', sound='null', ledColor='null', lockScreenVisibility=1, groupKey='null', groupMessage='null', actionButtons=null, fromProjectNumber='null', backgroundImageLayout=null, collapseId='null', priority=0, rawPayload='{"custom":"{"i":"95ac3b4e-a75f-4f13-a1c1-72b5d13d880c","a":{"foo":"bar"}}","alert":"English Message","title":"English Title","hms.sent_time":"0","hms.ttl":"0"}'}}

My Sample REST Request:
image

And i have tried to debug, due to ttl = 0, the code cant execute the NotificationBundleProcessor.processJobForDisplay(this, fromBackgroundLogic);

image

@jkasten2
Copy link
Member

@KKChong Just a quick follow up, we are falling back to defaults if these values are not in PR #1531. This will address the side effects you are seeing due to this value being 0.

@nan-li
Copy link
Contributor

nan-li commented Jun 24, 2022

Hi @KKChong,

We made ttl fixes in #1528 and #1531. Checking in if your issue is resolved?

@emawby emawby closed this as completed Nov 10, 2022
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

4 participants