views:

176

answers:

2

How do I programmatically disable these notifications when a message is arriving on my symbian S60v3 phone:

  1. Message tone (I think I got that one)
  2. The led flashing
  3. The phone vibration
  4. The screen lights up
  5. The message icon (I think I got that one too)

and what SDK can I use? I prefer to use Python, but I do not think the Python SDK for Symbian is too complete, so I guess I have to be using C++

Any help is greatly appreciated, thanks

+2  A: 

I managed to disable all notification by creating a MMsvSessionObserver and doing the following in HandleSessionEventL:

TMsvId* entryId = STATIC_CAST(TMsvId*, aArg2);

CMsvEntry* msvEntry = myMsvSession->GetEntryL(entryId); 
TMsvEntry entry = msvEntry->Entry();

entry.SetNew(EFalse);
entry.SetUnread(EFalse);
entry.SetVisible(EFalse);

msvEntry->ChangeL(entry);
Teknolog
Thank you :-) I will try that. Does your code also disabled the flashing of the led and the screen lighting up?
Brian
Yes it is goes unnoticed by the user.
Teknolog
Unfortunately this doesn't always work - some faster phones will still beep before your code can get to the message.
Rob Charlton
+1  A: 

The bad news is that you can't rely on using the message centre APIs to watch for messages in order to handle them before user notification occurs. Often you will be able to handle them quickly enough, but on phones with faster processors the user will sometimes see some notification - either a beep, or the screen lights up etc. I used to use this method, then on the N95 the phone still beeped when an SMS arrived.

The good news is that if you are only concerned about SMS messages then there is a more reliable way of intercepting them so that the user never sees any notification. You can use a socket to receive the message before the message centre gets hold of it.

There's a worked example here: http://symbian.devtricks.mobi/tricks/silent%5Freceiving%5Fof%5Fsms%5Fmessages/

I switched my code over to something like this and found it worked much better. As far as I know there is no way to do this from Python.

Rob Charlton
Thank you, I had in the course of time since I asked the question stumbled upon this site also. It is exactly what I needed
Brian