Problem with Notifications

Hi all,
I have built the Android version of the driving game in the mobile course.
When I play it from my PC it works fine but when I try it from my phone the following happens.

  • Build and run, runs first time with 5 energy
  • Play the game 5 times
  • Notification pops up to recharge my energy
  • Clicking on the notification does not reset the energy to 5, it stays at zero.

This is sounding like a difficult issue to debug.
On a Samsung A12.
Tried uninstalling the app and doing another Build and Run - works fine 5 times and then the same issue.

I’ll keep checking my code but would love to know why acknowledging the notification does not reset the energy in this case.

cheers

Hi Marcus,

I’ve stepped in as the TA for the course and so i am a little bit behind on the content but i will be working over the next few days to catch up. (Internet permitting as engineer booked tomorrow).
I have a Samsung S4 and S5 that i can use to test this so i will be working through the first few sections.

It sounds like there is an issue when you click the notification to reset the energy to 5 so i would double check the code there.
If you can post the code that you have i can put a second pair of eyes on it as well.

Let me know if you find any solution in the mean time.

1 Like

Hi Marcus,

Sorry its taken me so long to get back to you as i reached the lecture today.
After a discussion with Nathan, the application has to be fully closed for it to be able to reset and open with the energy reset.
If you have the game minimised when the notification appears it wont have actually reset the energy.

I’ve confirmed this on Android and assume the same to be true for Ios but as i do not have a Ios phone i am unable to test this

1 Like

I’ll give this a test, thanks.

I’ve confirmed it works as long as I fully close the application before using the Notification.
Which of course makes sense as it is in the start method that we do the getInt() for the new energy.

Thanks for the help Marc.

I believe Nathan is working on a patch to resolve this :slight_smile:
Should be out in a few days.
He’s also patching the change in the simulator where we lose the device specifications

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms