const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074, 0x0000 };
const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065, 0x0000 };
newsInit();
// ...
res = NEWS_AddNotification(title, titleLength /* 4 */, message, messageLength /* 7 */, NULL, 0, false);
// ...
newsExit();
const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074};
const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065};
u16* dataTitle = title;
u16* dataMessage = message;
u32 titleLength = 4;
u32 messageLength = 7;
u32 imageSize = 0;
res = NEWS_AddNotification(dataTitle,titleLength,dataMessage,messageLength,NULL,imageSize,false);
It doesn't work
Code:const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074}; const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065}; u16* dataTitle = title; u16* dataMessage = message; u32 titleLength = 4; u32 messageLength; u32 imageSize = 0; res = NEWS_AddNotification(dataTitle,titleLength,dataMessage,messageLength,NULL,imageSize,false);
const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074,0x0000};
const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065,0x0000};
u32 titleLength = 4;
u32 messageLength = 7;
u32 imageSize = 0;
res = NEWS_AddNotification(title,titleLength,message,messageLength,NULL,imageSize,false);
Did you PROPERLY initialize the mews module using newsInit(); ?This doesn't work
Code:const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074,0x0000}; const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065,0x0000}; u32 titleLength = 4; u32 messageLength = 7; u32 imageSize = 0; res = NEWS_AddNotification(title,titleLength,message,messageLength,NULL,imageSize,false);
#include <3ds.h>
int main(int argc, char **argv)
{
newsInit();
const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074, 0x0000 };
const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065, 0x0000 };
Result res = NEWS_AddNotification(title, 4, message, 7, NULL, 0, false);
while ( aptMainLoop() )
{
hidScanInput();
if (res)
break;
if (hidKeysDown() & KEY_START)
break;
}
newsExit();
return 0;
}
You have CFW so you can use news:u, it doesn't work when using news:s, it's a ctrulib issueCode:#include <3ds.h> int main(int argc, char **argv) { newsInit(); const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074, 0x0000 }; const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065, 0x0000 }; Result res = NEWS_AddNotification(title, 4, message, 7, NULL, 0, false); while ( aptMainLoop() ) { hidScanInput(); if (res) break; if (hidKeysDown() & KEY_START) break; } newsExit(); return 0; }
This works for me when I run as cia.