Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 139
Registered: ‎05-24-2011
My Device: Z30 running 10.2 and Playbook 4GLTE running OS2.1
My Carrier: rogers

Notification error 1 causes high CPU?

Hi gang,

 

one of the features of my app is being able to set a notification in the Hub.

 

I have been wrestling with a bug in my app where CPU spikes, basically consuming 50% of system resources until it's killed.

 

I've been trying to isolate the cause, and i *think* i have finally found it.

 

Occasionally, when i call ->notify(), I get a return code of 1 (which is "Unknown" according to https://developer.blackberry.com/native/reference/cascades/bb__platform__notificationerror.html#enum...)

 

the code that generates the Notification is very basic.  here:

 

Notification * pNotification = new Notification();
bb::platform::NotificationError::Type ret;
pNotification->setTitle("ALERT: ");
pNotification->setBody(notifBody);
//  pNotification->setIconUrl();  // NOTE: when you upgrade to 10.2
ret = pNotification->notify();
qWarning() << QDateTime::currentDateTime() << " : " << "return code for notify() was: " << ret;
ret = pNotification->clearEffects();
qWarning() << QDateTime::currentDateTime() << " : " << "return code for clearEffects() was: " << ret;
delete pNotification;
//	pNotification->deleteLater();  // couldn't seem to get it to work with this

 So, in cases where the CPU spikes, the return code for notify() was 1.

 

Does anyone know what could cause this?  Or even better, a way to recover from it?  Once this happens, the only thing I seem to be able to do is stop the app.

 

any insight appreciated!

 

thx,

 

J

bron: a cron-like scheduler for BlackBerry 10
http://apps.oddelement.com
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Notification error 1 causes high CPU?

If this is true and you have the profile data to back it up I suggest submitting a report to BlackBerry via JIRA.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.