-
-
Notifications
You must be signed in to change notification settings - Fork 187
Description
Bug Report
What's the issue you encountered?
Hello !
So I've been messing with the Notifications api (NEWS) but i quickly noticed that some of the functions were never returning successful codes. Well, every single one actually, except NEWS_AddNotification.
Checking the code I saw that the "news:u" system service was being used over the "news:s"
According to 3dsbew, "news:u" supports only one command compared to literally every single command for "news:s". I don't know why ctru does this but this leads to none of the NEWS_* functions currently working.
Manually replacing srvGetServiceHandle("news:u") with srvGetServiceHandle("news:s") here magically fixes
idk what else there is to add, it literally doesn't work lmao
How can the issue be reproduced?
newsInit(); // shouldn't fail
u32 notificationCount;
Result result = NEWS_GetTotalNotifications(¬ificationCount); // this will very much fail
printf("Result code: 0x%08lX", (u32)result); // prints '0xD900182F'
There's also a pretty easy way to notice this with no lines of code. If you install NotifyMii you'll see the application is very unstable and will crash pretty quickly. This is because NotifyMii always assumes api functions are successful (which they currently very much aren't) and reads garbage data.
Fix
news.c : Replace res = srvGetServiceHandle(&newsHandle, "news:u"); with res = srvGetServiceHandle(&newsHandle, "news:s");