Background task on iOS - codenameone

I plan to create a business app that runs on iOS and communicates with a webservice. The app is meant to be an online app, but when there is no internet connection, the user should still be able to register a notification locally and the app should send the notification automatically (without further user intervention) as soon as there is an internet connection again. This should also work when the user closes the app while he has no internet connection.
Is it possible to do this on iOS? (I know it works on Android with a service)
Does this need a special permission ?
Thanks

Check out this developer guide section, specifically the part about local notifications in iOS and Android.
Notice that services can work in native code but the local notifications are portable.

Related

listen to Firestore's onSnapshot while app is not running

I want my app to be able to listen to onSnapshot while it is in background , I know that I can use background task for this by I don't know how to set it up .
btw I'm trying to implment this so that my app can push a notification whenever a new doc is received while app is in the background .
Most mobile operating systems severely limit what the app can do while it is backgrounded. Keeping an active connection open to a server is one of those things that has never been allowed on iOS, and has gotten more restrictive with recent Android versions.
The better approach is to run the code that detects a relevant change on a server, and then use Firebase Cloud Messaging (or APNS directly if you're only targeting iOS) to send a notification to the user. When they they tap on that notification, your app is started and you can load the data from Firestore.
If you don't want to run your own server, Cloud Functions is a common alternative for this, as it has built in triggers that respond to changes in Firestore. For an example of this exact scenario, see the documentation on notify users when something interesting happens.

Show desktop notification from one windows app (WPF) to another using webservice call

I have created WPF app and installed in two different PC. now I want that when I click one button from app in 1st PC, then I should get desktop notification in 2nd PC.
So I don't know how it will be done. Whether I have to use WCF or not or anything else? If I've installed this app in multiple PC then how should I send notification to particular?
I've tried to use signalR but I didn't understand how to invoke windows form method.
The application will not be closed. it'll just minimized in the tray. so my idea is that we can invoke App method from using WCF and show notification.
I want this kind of notification for my app but from webservice:
You can use self hosted WCF like here:
https://msdn.microsoft.com/en-us/library/ms731758(v=vs.110).aspx
Use net tcp binding, it will not require administrative rights.
Also there is a need to maintain a list of addresses/hosts of the PCs where your app runs. Then according to some logic you have there, choose the one that should show your notification.
You can also use a central app that coordinates, it may be a web app. Then signalR can be helpful. It becomes like a standard chat app... google can find you plenty of implementations for that.

Force phonegap disconnect

I need to test the online and offline events written in my app. I'm testing the app through my browser so I'd like some code that simulates a disconnect from the internet in phonegap. As in forcing it to go offline then back online, client side. How can I do this?
Have you already tried use PhoneGap Emulation? There is a lot of features.
You can also test directly on device. Android logcat can receive the console.log of browser. I belive this works with xcode too.

Push notifications on mobile apps

OK, how do push notifications work?
I found a nice tutorial: http://lessons.runrev.com/m/4069/l/59312
I get the concept that the device needs to register with the server but does the app essentially hold an AJAX connection to server or does the server somehow plug into the mobile phone network... ?
There are three essential components when talking about push notifications:
Your server
The providers server
Your mobile device
Your server is the sender. It sends the push notification to the providers server, which in turn sends it to the device. Your device, therefore, is the receiver. (Concluding that you don't have to "plug into the mobile phone network", this is all done by your provider - Google in this case)
Within your mobile application you just register an eventhandler which is fired when you receive a push notification.
Google called this C2DM (Cloud to Device Messaging), now GCM (Google Cloud Messaging) - you can get an introduction inclusive of an architectural overview and demos here at android.com.
To answer your question I know:
Both push notifications services (Apple's and Microsoft's) are using a persistent IP connection for implementing their push notifications functionality.
I think Android works the same way (at least with Android Cloud to Device Messaging (C2DM)). "It uses an existing connection for Google services". http://en.wikipedia.org/wiki/Android_Cloud_to_Device_Messaging_Service
But the answer is closer to AJAX, except I assume it is a simple "http" connection to Google Messaging service from Android, and the OS gets an alert of a new message and relays it back to a program that registered on it to want notifications.

Silverlight 4 launch a trusted application into the browser?

I just lost 5 hours looking for a answer which i haven't been able to find :p
First, I'd like to force a trusted application (i need to access the file system) to display into the browser. Based on what i found on google a trusted application must be installed and launched as a desktop application (also called out-of-browser application).
So, i want to have an installed application on the client side but meanwhile, the user must also be able to start this same application into a browser window when he goes on my web site. Is this possible ?
Second, I'd like to give to the user the possibility to start the application from the browser. To be clear, the application is installed on the client computer but i want a button on my web site which starts the desktop application. How can i do that ?
Thanks
The answers are sort of and no.
Yes you can run an application that has been installed on the client also in the browser. However, not all of the installed application features will be available. Anything that requires elevated trust will not work inside the browser.
No you can't launch the installed application programmatically from within code running in the browser. The best you can do is display a polite message to the user to the effect that they have this app already installed and in order to access all of its feature they will need to launch it.
Yes, it is possbile since Silverlight 5, see my answer on silverlight-4-elevated-permission-inside-the-browser

Resources