notice.notify throwing an error with example code
colindean opened this issue · comments
From the API reference:
macgap.notice.notify({
title: "Notify",
content: "New Message!",
sound: false // optional
});
Also tried
macgap.notice.notify({title: "Notify",content: "New Message!"})
Receives:
TypeError: 'undefined' is not an object (evaluating 'macgap.notice.notify')
line: 1
message: "'undefined' is not an object (evaluating 'macgap.notice.notify')"
stack: "eval code↵eval@[native code]↵_evaluateOn↵_evaluateAndWrap↵evaluate"
__proto__: Error
constructor: function TypeError() {
length: 1
name: "TypeError"
prototype: Error
__proto__: function () {
message: ""
name: "TypeError"
toString: function toString() {
length: 0
name: "toString"
__proto__: function () {
__proto__: Error
constructor: function Error() {
message: ""
name: "Error"
toString: function toString() {
__proto__: Object
Try it
<script type="text/javascript">
if (macgap.notice) {
macgap.notice.notify({title: 'MacGap', content: 'Using native OS X notifications'});
} else {
macgap.growl.notify({title: 'MacGap', content: 'Using Growl notifications'});
}
</script>
@BelinChung Are you saying it does work ok, using your code sample?
Notify.notify()
in MacGap 2 has been deprecated. See the docs at:
http://docs.macgap.com/ref/notify.html
and
MacGap.notify()
at http://docs.macgap.com/ref/macgap.html