Activity and WLM

Hello,

i'm developping an activity, and i would like to get the incoming messages from WLM to use them in my activity. Is it possible and how

Thank you.

R.P.



Answer this question

Activity and WLM

  • Umachandar Jayachandran - MS

    Thank you J-Thread,

    i tried to do what you wrote, but it don't work.

    I've set ReceiveIM to True, and i added the followinf function in my activity:

    function Channel_OnDataReceived()
    {
    // Instant message was received; inspect the value of Channel.IM
    // If application has ReplaceIM permission, Channel.IM can be written to before it is displayed.

    alert("Channel_OnDataReceived");
    }

    But when i receive an IM, the IM is displayed as usual, and the alert is not triggered.

    Did i forgot something

    R.P.


  • Romantic_touch

    Well, you did something wrong, because else it would work, but it wasn't your fault. We just found a bug in the Api...
    It took me a while to figure out what was wrong, but then I saw it. The function should be called Channel_OnIMReceived, as it is called in the VBScript example!
    So, what the code should look like is:
    function Channel_OnIMReceived() {
    // Instant message was received; inspect the value of Channel.IM
    // If application has ReplaceIM permission, Channel.IM can be written to before it is displayed.
    alert(window.external.Channel.IM);
    }
    This is tested, and (as expected) alerts the messages that you send

  • ScottPGlover

    Ok, it work fine.

    Thousand thanks J-Thread, you're the One :)

    Good luck and have fun :p


  • KHadden

    Haha no problem... And I am the One Haha thanks
  • jag108

    Yes it it possible.
    In your msgrp2p.xml file, set "ReceiveIM" to True. Then implement the following function:
    function Channel_OnDataReceived() {
    // Instant message was received; inspect the value of Channel.IM
    // If application has ReplaceIM permission, Channel.IM can be written to before it is displayed.
    }
    However, keep in mind that activity's have to be provisioned before they can be used on the MSN network, and I am not sure if they will allow you to have the ReceiveIM option set to true. I guess you should send an e-mail to bizdesk @ microsoft about that.
    P.S. I did not test this, but I just got this information from the official documentation, so it should work.

  • Activity and WLM