I am building a push notification on Phonegap. I reviewed the way of using the Push Plugin but it is not supporting windows phone. I plan to use Javascript non stop looping by every 15 mins to query the Rest server and get the message back to display if any message is ready to published. Do you think this is a good idea? Will this cause any app leaking and slow down the app?
You will shoot yourself in the foot doing so.
Why? Your app will only be able to "receive" push notifications if it is active. If your app is inactive, you won't be able to poll for new notifications and therefore won't get any. So you're missing the actual great benefit of push notifications.
Solution: Pull the new version of the Cordova Push Notifications Plugin. Support for Windows Phone 8 was added recently. That's the way to go.
Related
we are developing a web application (HTML/CSS/JS) on Tizen SSSP4 and SSSP5 devices.
According to SAMSUNG changing tthe version number of the application in sssp_config.xml will cause the display to update next time the application is to be launched.
However when I update the app version and reboot the display using
b2bapis.b2bcontrol.rebootDevice
it will sometimes update, yet other times it will not. Usually it will not update on the first time, yet update if I call the same API once more after the display has restarted. Sometimes the display will get stuck and no longer update even if I reboot multiple times using the API.
I checked the web connection, which is fine. The display is connected via cable, between the display and my server is but a switch. Also I see the display in WEINRE using a webhook all the time.
Has anyone encountered this problem? What can be done to resolve this? Is there something that must be done when unloading the app in order to release the API properly?
Thanks.
I would keep my PhoneGap application in background after closing it in order to generate notifications.
I wish my application available on iOS , Android and Windows Phone with notifications.
Is it possible to execute the JavaScript when the application is in the background ?
How to do ?
On iOS there are two kinds of notifications - remote notifications and local notifications. Remote notifications are delivered by your webservice through APNS and require for the device to be connected to the internet.
Local notifications on the other hand are scheduled on device. The most important thing is that both will wake your app for a short time, so it can consume the notification and decide what to do with it. During this time you can of course schedule another local notification.
This - https://github.com/katzer/cordova-plugin-local-notifications - seems like a good place to start investigating.
Is it possible to keep a html 5 web pages WebSocket connection open in Mobile-Safari once the screen is locked?
I want to send my users continuous updates throughout the day and it seems silly that their screens should always have to be unlocked to receive those notifications.
Are there any other options?
I don't think it's possible to keep the connection open while the browser is in the background, or when the screen is locked, the reason being that the app is essentially frozen in memory. Here's a quote from a similar question:
the reason you cant keep a network socket open, is that without your app jumping to the foreground when it receives a connection, it cannot respond to network traffic(because if it is not in the foreground its memory content is frozen).
However, I did find this page on Push Notifications for Websites that shows you 'how to sign up your users to receive notifications even when your site is not running in Safari'.
There are some other options: if you want to send continuous updates, you could write an app and either follow the instructions on Apple's site to keep a socket open permanently, or you could configure the app to implement Push Notifications.
I'm sorry I couldn't find a quick fix, but I hope at least one of these options works for you!
I have found a hacky way to keep WebSocket alive in Mobile Safari.
Basically it's the same solution as for this question.
Create an infinity looping audio file to keep Javascript running:
<audio loop src="http://www.sousound.com/music/healing/healing_01.mp3"></audio>
Note: some user interaction is required to initiate the audio file.
It would be nice if a WebSocket kept the browser alive in the same manner as an audio or video file.
PS this also works on Android.
I am developping an app for Ipad (2 and 3).
The app needs a continuous synchronization with a remote web app. Point is, my app needs to keep "listening" whenever there is connectivity in order to receive updates (lots of data), alerts,... etc.
PS: Before going further I would like to highlight that my app is not targeted to the appstore and moreover it can't rely on push notifications.
What I am confused about is the multitasking on the ipad. I would like my app's local db to stay synchronized by communicating with the remote web app. And hence my questions are:
Does any of the ipads have a real multitasking? (like android's where you can have "services") Meaning that my app or at least a small part of it would still operate even if it is not active on the screen.
How can I achieve that using phonegap standard framework?
If the above points show that at some extent it's not possible. Is there still a possibility to extend phonegap with a plugin and make this happen?
If the above three points are unfortunately fully negative; how would you address the problem by keeping in mind that the syncrhonization involves a lot of data and is mandatory to cover the app's usability?
Does any of the ipads have a real multitasking? (like android's where
you can have "services") Meaning that my app or at least a small part
of it would still operate even if it is not active on the screen.
IOS only has limited background services - in that your app goes into a background state when not active. Really only limited to receiving push notifications. As Phonegap uses a webview and javascript that is only active when the app is active in the foreground.
How can I achieve that using phonegap standard framework?
If you want to keep data connection open you might have to look at development of an application for a computer tablet, rather then an IOS device.
If the above points show that at some extent it's not possible. Is
there still a possibility to extend phonegap with a plugin and make
this happen?
No.
If the above three points are unfortunately fully negative; how would
you address the problem by keeping in mind that the syncrhonization
involves a lot of data and is mandatory to cover the app's usability?
You only option (if you can only use phonegap) is to have the app active all the time, and set a constant sync using Jquery & XML/JSON data. Of course this depends on what type of data you are going to show. For showing a page of data - similar to a webpage you won't have any problems - as long as you understand once you change apps that data won't be synced.
I would like my app's local db to stay synchronized by communicating with the remote web app.
If I were you, I'd be questioning why would I need to do that? Why not just make the app works online? You can have all the assets locally, and just setup some sort of API to retrieve whatever data you need to display on demand.
Otherwise, you'll need to hack your way through to do all the things you wanted, plus you need offline / online syncing. Since you have most data available offline, I assume the app also works offline? And you'll have a really bad time working on offline / online syncing...
I have a web application (chat room) in html + javascript that basically sends requests to the server every 5 seconds to check for new messages.
It already works on mobile but there are 2 main problems:
it does not beep (it works on pc) with new messages
when the browser is put on background, the javascript obviously stops being executed, therefore the connection to the server is lost and the client disconnected.
i was thinking of using phonegap not only to make it cross-platform but also to fix those problems stated above. would they be resolved with the use of phonegap?
thank you in advance.
phoneGap doesn't support custom push notification. it basically open a browser and expose you some native support via API.
in order to do some native actions like push notifications and/or sound playing i suggest you check out some of the plugins options available or even write your own for that.
Playing sounds can be done easily using the Media API. As for having the JavaScript run in the background it really depends on the OS. On Android the JS will continue to run if you leave the app via the home button but the back button kills the app so you would stop the JS. It is probably better to write a service that always runs in that case.
Alternatively you'd look at a push type solution to notify you of new messages.