Homebrew NEWS_AddNotification crashes

Woni

Active Member
OP
Newcomer
Joined
Jan 2, 2016
Messages
30
Trophies
0
Age
104
XP
89
Country
France
Result res = NEWS_AddNotification(u"title",5,u"message",7,NULL,0,false);

It crashes, please help.

EDIT: ctrulib code is broken atm with news:s
 
Last edited by Woni,

Gocario

GBAFail'd
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
You shall declare an u16 string as:
Code:
const u16 title[] = { 0x0074, 0x0065, 0x0073, 0x0074, 0x0000 };
const u16 message[] = { 0x006D, 0x0065, 0x0073, 0x0073, 0x0061, 0x0067, 0x0065, 0x0000 };

And use it as:
Code:
newsInit();

// ...

res = NEWS_AddNotification(title, titleLength /* 4 */, message, messageLength /* 7 */, NULL, 0, false);

// ...

newsExit();
 

Woni

Active Member
OP
Newcomer
Joined
Jan 2, 2016
Messages
30
Trophies
0
Age
104
XP
89
Country
France
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 = 7;
    u32 imageSize = 0;
    res = NEWS_AddNotification(dataTitle,titleLength,dataMessage,messageLength,NULL,imageSize,false);
 
Last edited by Woni,

Slashcash

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
338
Trophies
0
XP
611
Country
Italy
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);

You seem a little confused on what a pointer is, an array is and how to use them properly. I suggest you to read some more about the topic before proceding.
 

Woni

Active Member
OP
Newcomer
Joined
Jan 2, 2016
Messages
30
Trophies
0
Age
104
XP
89
Country
France
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);
 

UraKn0x

Official senpai
Member
Joined
Mar 20, 2014
Messages
370
Trophies
0
XP
735
Country
France
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);
Did you PROPERLY initialize the mews module using newsInit(); ?
 

Woni

Active Member
OP
Newcomer
Joined
Jan 2, 2016
Messages
30
Trophies
0
Age
104
XP
89
Country
France
Code:
Result res = newsInit();
if(R_FAILED(res))
    printf("news service failed init\n");
else
    printf("news service init successful\n");
Yes
 

Ryuzaki_MrL

Green Thunder
Member
Joined
Jun 23, 2015
Messages
781
Trophies
0
Age
26
XP
2,045
Country
Brazil
Code:
#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.
 

Woni

Active Member
OP
Newcomer
Joined
Jan 2, 2016
Messages
30
Trophies
0
Age
104
XP
89
Country
France
Code:
#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.
You have CFW so you can use news:u, it doesn't work when using news:s, it's a ctrulib issue
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • The Real Jdbye @ The Real Jdbye:
    like bronys
  • The Real Jdbye @ The Real Jdbye:
    sonic porn is too weird even for me
  • Dumpflam @ Dumpflam:
    bruh
  • Dumpflam @ Dumpflam:
    guys how do i delete a post
  • The Real Jdbye @ The Real Jdbye:
    you don't
  • The Real Jdbye @ The Real Jdbye:
    you can report it and request deletion
  • BakerMan @ BakerMan:
    Also, no, that was his first time having a seizure, and hopefully the last
    +1
  • K3Nv2 @ K3Nv2:
    Ea play raised priced to $6 a month lol
  • BigOnYa @ BigOnYa:
    Same with uremum, she's now $2 a month
    +1
  • K3Nv2 @ K3Nv2:
    Also seizures come and and go they don't have an off switch like that it all depends
  • BakerMan @ BakerMan:
    alright guys, who would win, sonic or goku?
  • BigOnYa @ BigOnYa:
    Knuckles
  • BakerMan @ BakerMan:
    knuckles vs broly could also be a good one tbh
    +1
  • BigOnYa @ BigOnYa:
    Bakerman vs. Wario
  • BigOnYa @ BigOnYa:
    Announcer - "Ok folks we have a good fight today, Bakerman takes on Wario. This should be a good fight. Wait...why is bakerman undressing?"
  • BakerMan @ BakerMan:
    Oh sorry, this is Wario? I thought it was your wife
    +1
  • E @ eenterx:
    hello guys how do i type on forums?
  • E @ eenterx:
    i am the new user
    +1
  • BigOnYa @ BigOnYa:
    I am the Eggman... I am the Walrus...
    +1
  • E @ eenterx:
    oh ok
  • RedColoredStars @ RedColoredStars:
    What does it tell you when you try to type?
  • BakerMan @ BakerMan:
    @BigOnYa speaking of eggmen... eggman for smash
  • RedColoredStars @ RedColoredStars:
    You click where it says "Write your reply..." and start typing? lol
    +1
  • BakerMan @ BakerMan:
    wow yeah john does suck
    BakerMan @ BakerMan: wow yeah john does suck