0
我最近一直在使用opensocial,但一直在使用通知时遇到问题。opensocial通知
我的代码是:
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Notifications" description="" height="300">
<Require feature="opensocial-0.8"/>
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/javascript">
function sendNotification(title, body) {
var params = {};
params[opensocial.Message.Field.TITLE] = title;
params[opensocial.Message.Field.TYPE] = opensocial.Message.Type.NOTIFICATION;
var message = opensocial.newMessage(body, params);
var recipient = "VIEWER";
opensocial.requestSendMessage(recipient, message, callback);
};
function callback(data) {
if (data.hadError()) {
alert("There was a problem:" + data.getErrorCode());
} else {
alert("Ok");
}
};
sendNotification("This is a test notification", "How are you doing?");
</script>
]]>
</Content>
</Module>
当我安装和运行这个小工具,我没有得到任何警告或通知,而我很为难!
任何想法?
你在哪里测试这个小工具? – 2013-04-07 17:59:59
WebEx Social VM – HelloWorld 2013-04-08 08:51:26
我对该容器不熟悉,不知道它是否支持该API,对此抱歉。 – 2013-04-08 23:11:09