Is the following behaviour possible with a PWA:
App coming to the foreground after5/15/30 minutes (scheduled) after sending app to background?
Thanks!
Related
I am developing both android and iOS application using the nativescript-angular framework. I am using a nativescript-plugin-firebase plugin for the fcm push notification. In the iOS platform, the notification is coming both in the foreground as well as in the background. But in android, the notification is coming only when the app is in the background.
How do we fix this issue?
My firebase initialization code:
firebase.init({
showNotifications:true,
showNotificationsWhenInForeground:true,
onPushTokenReceivedCallback:(token)=>{
console.log("onPushTokenReceivedCallback:",{token});
},
onMessageReceivedCallback:(message:firebase.Message)=>{
console.log("onMessageReceivedCallback:",{message});
})
.then(()=>{
console.log("Initialized");
})
.catch(error=>{
console.log("Initialize",{ error });
});
I'm struggling with Notifications too right now,
you can use Nativescript-Local-Notification plugin alongside with firebase plugin like me, you can have much more customized notifications and can handle them much better in client-side.
just schedule a local notification when you get your firebase callback.
it perfectly works in the foreground, I'm struggling to make it work in the background, in the background I just keep getting Firebase notification, can't disable it.
"I am explaining whole scenarios here in order to avoid multiple discussion threads, as I am looking for quick help, so providing here all the details."
I have created a application which communicates with the android companion app, which has some of events scheduled and needs to send to pebble app, so that even if the timeline is muted for our app we can provide important information to pebble app user.
I am able to get the data from companion app and process it successfully only if the pebble app is open but my one more requirement is :
To get data in pebble app sent by companion app, even if my pebble app is in background.
ie. If the companion app sends me some message but the pebble app is in background so I should be able to read that message and wake up the Pebble app to show the desired information.
I am using "App Message" for communication between Companion app and Pebble app.
I gone through the Pebble Documentation which states :
"Background workers do not have access to the UI APIs, they also cannot use theAppMessage API or load resources. Most other APIs are available includingAccelerometerService, CompassService, DataLogging and Storage."
One more Query is :
As we can get notification in our Pebble if its came to Phone, so is there any way to open some desired app or related app to that message in Pebble watch.
Please guide me if there is anyway to get this done.
Thanks in advance.
Your Android application can launch the watchapp before sending the message to her. That should solve your problem.
As indicated in the documentation, the background worker on the watch cannot receive app messages.
I have created an app that triggers video at particular time similar to alarm, but the problem I am facing is that when I am out of application & have set the timings the video doesn't show up(i.e. similar to alarm I should get notification out side my app). Please help me out with the same. Would be very grateful for any helpful suggestion.
When an application is not running, you cannot predict what time its background process will execute, so there is no way that you can set an alarm with any degree of precision smaller than perhaps an hour. The only way to have timing close to accurate would be with a push notification from a server. Even then, the notification you receive will not be able to open and play video on its own. You could create a push/toast notification that originates at a server, sends the user a toast, the user taps it, and that opens the app to play the video. You can't do it without user intervention.
See this link for an overview, including the constraints on background agents: http://msdn.microsoft.com/en-us/library/hh202942(v=VS.92).aspx
You cannot open an app and play a video from a background agent. You can show a toast notification that would allow the user to open the app. You can use a Scheduled Agent or PeriodicTask.You can then use the ShellToast to show a toast notification so the user can open the app. Once the app is open you can start the video.
So, Ive made Windows Phone app that contains rss-feeds. I would now like to add the possibility for toasts to popup when a stream is updated. Ive read up on how to use Toasts to notify the user, but how can i make my rss-reader periodically poll the rss-feeds for the latests news when the app is suspended in the background. Example code would be highly appriciated!
Check the "Background Agent Sample" Windows Phone Code Samples to see how you can create a periodic background agent, that will allow you to pool the rss feed(s) and show a toast notification to the user!
I have implemented push notification in my app and it works fine when the app is not running. But when my app is send to background then no alert is being displayed regarding the push notification. What do I need to do so even if my app is in background I can display alert for push notification.
Any help would be appreciated.