Push notification doesn't appear (DEF-3728) (SOLVED)


#1

I use this code for push messages:

local id,  err = push.schedule(10, "Find the key", "text message", "{}", { action = "Play now" })

After 10 seconds I hear sound, but notification doesn’t appear.
OS - Android 5.1


#2

Do you have the game running and active or is it in the background?


#3

in the background


#4

Hmm, @sven?

Have you set a push icon in game.project by the way?


#5

Not yet. I will try.


#6

no changes - I hear sound but notification doesn’t appear

2019-01-17_010553_no_notification


#7

What if you add all the images?

And may I ask why you are using the old editor?


#8

2019-01-17_021626_no_2


#9

I’m just used to


#10

We will very soon remove support for the old editor and stop updating it. We no longer add functionality and you’re really missing out on many improvements if you don’t migrate to the new one.


#11

Ok, so same problem after adding all images? What device have you tested this on?


#12

Yes. Meizu M3 Note


#13

Ok, hmm, could you share the project (or a minimal repro) with me (bjorn.ritzl@king.com)?


#14

I just added you


#15

Just to help @britzl out, and shorten the turnaround times, what’s the name of your project?


#16

test_push


#17

Ok, so I started to take a look at the issue:

  1. You will not get a notification in the Android notification area when the game is running. You should only get that when the app is in the background
  2. The engine crashes if you create a local notification without any icons set and switch out of the application before the notification triggers. Created DEF-3727
  3. I added push icons (generated using https://romannurik.github.io/AndroidAssetStudio/icons-notification.html) and also app icons. When I scheduled a push and switched out from the app I got a notification as expected (see screenshot below):

device-2019-01-18-073238

01


#18
  1. I know that
  2. Also app crashed when payload is empty string.

I just tested the app on Android 8 and it works! Problem was and still on Android 5.1.


#19

Ok, created DEF-3728 to track this.


#20

Hi @igor!

I’m trying to fix so that push notifications;

  • Can be displayed even if there isn’t a valid icon being set.
  • Will throw an error if the supplied payload is invalid, during the call to push.schedule instead of failing later when triggered.

However, I haven’t been able to repro your issue exactly, but I suspect the fixes above will avoid crashes. Could you add me to your test_push project as well?