×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Using mncnnotification?

    Hi,

    I'm trying to trigger the messages received dialog, email alert tone, and email notifcation using mncnnotification. I followed the examples from the url below and the header file in the sdk. All I can have happen is the light to go on. But the alert tone, new messages received dialog/note, and indicator do not show up. I am using EIndicationNormal which is defined as:

    EIndicationNormal = EIndicationIconBit | EIndicationToneBit.

    Has anyone gotten this to work?



    http://www.forum.nokia.com/document/...ur_own_MTM.htm


    Code:
    * Example usage
     *
     * @code
     * #include <badesca.h>	// CDesCArray
     * #include <mncnnotification.h>	// ECOM interface to notification system
     *
     *  // Get an instance of the ECOM interface to the notification system.
     *  MNcnNotification* notifyNewMessageEcom = 0;
     *  TRAP(err, notifyNewMessageEcom = MNcnNotification::CreateMNcnNotificationL());
     *
     *  // Check for errors
     *  if(notifyNewMessageEcom && err == KErrNone)
     *      {
     *      // The interface is supported on this phone.
     *      CleanupDeletePushL(notifyNewMessageEcom);
     *
     *      // Now notify the framework that new messages have been received
     *      // First create a descriptor array for aInfo - even though it isn't used presently.
     *      CDesCArray* tempArray = new (ELeave) CDesCArrayFlat(3);
     *      CleanupStack::PushL(tempArray);
     *
     *      // Notify the framework that there are new messages.
     *		// This can return an error value.
     *      err = notifyNewMessageEcom->NewMessages(aServiceId, MNcnNotification::EIndicationNormal, *tempArray);
     *
     *      // Cleanup the descriptor array.
     *      CleanupStack::PopAndDestroy(tempArray);
     *
     *      // Clean up the ECOM interface now.
     *      CleanupStack::PopAndDestroy(notifyNewMessageEcom);
     *      }

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Using mncnnotification?

    We used it before without a problem.
    Are using your own MTM? It sounds like your service id is wrong or you have no unread messages in your inbox.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    Quote Originally Posted by Paul.Todd View Post
    We used it before without a problem.
    Are using your own MTM? It sounds like your service id is wrong or you have no unread messages in your inbox.
    Yes I am using my own MTM. My service id seems to be right. I have created my own Inbox folder under my service entry (mailbox). Then the new emails are added to that Inbox folder.

    When I create the email, I am doing the following. I just realized setting the service Id to the inbox folder id is probably the reason. I guess I should call the notification API with the inboxFolderId instead of my service id?

    emailEntry.iServiceId = inboxFolderId;
    emailEntry.SetNew(ETrue);
    emailEntry.SetVisible(ETrue);
    emailEntry.SetInPreparation(EFalse);

    Thanks Paul!

  4. #4
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    Well I tried calling the notification API with the inboxFolderId instead of my service id, but result was -1.

    Code:
      TInt result = notification->NewMessages(
                   inboxFolderId,
                   MNcnNotification::EIndicationNormal, *dummyArray);
    I then tried storing the email in the KMsvGlobalInBoxIndexEntryIdValue, and calling notification:

    Code:
      TInt result = notification->NewMessages(
                   KMsvGlobalInBoxIndexEntryIdValue,
                   MNcnNotification::EIndicationNormal, *dummyArray);
    Then I got the notification. So my question now becomes, is it possible somehow to call notification on my own inbox folder whose parent is the service entry (mailbox)?

  5. #5
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    Anyone know the answer to this? Can mncnnotification be used with remote entries (i.e. called on my MTM's inbox?)

    Thanks!

  6. #6
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Using mncnnotification?

    I had a quick look at our MTM code and in the our sync client we just use the TMsvId of the service entry for the mtm.
    We also use MNcnNotification::EIndicationNormal rather than anything else.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  7. #7
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    Quote Originally Posted by Paul.Todd View Post
    I had a quick look at our MTM code and in the our sync client we just use the TMsvId of the service entry for the mtm.
    We also use MNcnNotification::EIndicationNormal rather than anything else.
    Thanks for checking Paul. It seems like I must be missing something. I have a few folders under the service entry for the mtm. New message are added to the Inbox folder. Then when passing the MncNotification API the service ID, does it recurse all folders under the service entry to see which emails have Unread() == ETrue? I'm guessing probably not.. maybe I have to set something on the inbox folder as well.

  8. #8
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Using mncnnotification?

    AFAIK it does the looking itself can you send me an email with your address?
    Really there are about 5 line of code in the project to do with notifications.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  9. #9
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    Re: Using mncnnotification?

    Hello,

    I am attemting to do the same thing. I pass in my service entry ID into the NewMessages() function and everything else is exactly as the example that Nokia provided.

    The new messages are located right in the service entry but there are also subfolders that are empty for the most part.

    Do I need to anything else to get the message icon appear on the status bar? Is there a flag that needs to be set on the service entry itself?

    I tried this with E90 and E51 device without any luck...

    -Ken

  10. #10
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    On my E51, I just get the sound notification, but not a note (E51 doesn't use notes when new messages arrive e.g. sms, and just shows "New messages (count)" on the main page". However, other users who have E61 reported to me that they do get the new messages note. I have just set the email status indicator '@' myself using the publish and subscribe APIs. I need to test on more devices..

    Make sure your new email entry iServiceId is the same id as the one you pass to NewMessages and that the messages are unread.

  11. #11
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    Re: Using mncnnotification?

    Hi tcalamawy,

    Quote Originally Posted by tcalamawy View Post
    I have just set the email status indicator '@' myself using the publish and subscribe APIs. I need to test on more devices..
    - How do you set the '@' using P&S? could you post and example code, please?

    Quote Originally Posted by tcalamawy View Post
    Make sure your new email entry iServiceId is the same id as the one you pass to NewMessages and that the messages are unread.
    - double checked and the iServiceId is identical to the iParentId and is the same as the service ID that I pass into the NewMessages() funciton. Also the "New" and "Unread" flags are set...

    -Ken

  12. #12
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    Re: Using mncnnotification?

    Quote Originally Posted by stalink View Post
    - How do you set the '@' using P&S? could you post and example code, please?

    Figured that part out - works well:
    RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail));

  13. #13
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    Yeah, its on the wiki here: http://wiki.forum.nokia.com/index.ph...mailStatus_API

    I'm not sure why you aren't getting notifications. Do you have the email alert tone set in your profile?

  14. #14
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    Re: Using mncnnotification?

    Quote Originally Posted by tcalamawy View Post
    Yeah, its on the wiki here: [url]I'm not sure why you aren't getting notifications. Do you have the email alert tone set in your profile?

    Are you saying that you used the MNcnNotification class' NewMessages() function and it did do the tone, the envelope in the status bar, and the dialog on the main screen?

  15. #15
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    92

    Re: Using mncnnotification?

    Quote Originally Posted by stalink View Post
    Are you saying that you used the MNcnNotification class' NewMessages() function and it did do the tone, the envelope in the status bar, and the dialog on the main screen?
    I definitely get the tone on my E51. I don't get the envelope in status bar, so that is why I set the indicator which turns on the '@'. Another user with an E61 mentioned he saw the dialog on the main screen but possibly only when he was on the main screen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •