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