multithreading - Running javascript function on background while receiving push notification? -


i know 1 has been asked before, not context of push notifications.

i'm developing app using ionic/cordova sends push notifications clients, new video messages them watch. videos not going streamed transferred client-side (not call), thought of implementing background javascript function store video on client-side when , while push has been received.

i have looked on web-workers , multithreading needs client-side running. javascript code has event listener when pushes being received, of course not executed until app being opened.

so question is, possible? i'll appreciate words of advice on matter, thanks!

i did in app using signalr push notification. app. chat app. client x can send rich text message pictures or video client y.

when client x send message, calls signalr server , server save message in server sql , save picture or video in web server.

if client y offline, message during next online. if client y on-line:

case 1: online in foreground: signalr server call client y javascript function update screen , local storage, client y see message , picture immediately. (and play sound)

case 2: online in background or mobile phone in screen safe mode: signalr server call client y javascript function update screen , local storage, play sound. send push notification client y too! when client y see notification, open app. , see message in local storage. (just whatsapp)


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -