Fuse: 1.5
OS: Sierra
Steps
-
fuse build --target=iOS -adebug
-
Run on iPhone (tested with a 5)
-
Tap “send notification in 5 seconds”
-
Close App
-
Tap notification
-
receivedMessage is not fired and therefore “Received Local Notification” is not added to the log
“This function is called whenever a notification is delivered while the app is open, or when the app is started from a notification the user has selected.”[Fuse]
If there’s something I’m missing, please let me know, thanks.
<App>
<JavaScript>
var LocalNotify = require("FuseJS/LocalNotifications");
var Observable = require('FuseJS/Observable');
var delay = 5;
var log = Observable();
function hello() {
log.add('hello');
}
LocalNotify.on("receivedMessage", function(payload) {
// console.log("Received Local Notification: " + payload);
log.add('Received Local Notification');
// LocalNotify.clearAllNotifications();
});
hello();
function sendLater() {
LocalNotify.later(delay, "Finally!", delay + " seconds is a long time", "hmm?", true);
}
function sendNow() {
LocalNotify.now("Boom!", "Just like that", "payload", true);
}
module.exports = {
delay: delay,
log: log,
sendNow: sendNow,
sendLater: sendLater
};
</JavaScript>
<DockPanel>
<TopFrameBackground DockPanel.Dock="Top" />
<ScrollView>
<StackPanel>
<Button Clicked="{sendNow}" Text="Send notification now" Height="60"/>
<Button Clicked="{sendLater}" Text="Send notification in {delay} seconds" Height="60"/>
<Each Items="{log}">
<Text Value="{}" Alignment="Center" />
</Each>
</StackPanel>
</ScrollView>
<BottomBarBackground DockPanel.Dock="Bottom" />
</DockPanel>
</App>