App update Notifications in Codename One - codenameone

I developed an app using codename one,and in that app i need to show notifications to user regarding the app update if update is available in playstore.LocationManger is working on mobiles with version 5 and above,but its not working on tablets.How to work with notifications in android/ios tablets with version using codename one.

First, you have to differenciate local notification (which is launched when app is running or in background) and push notification (which use Google or Apple server).
I suggest you to use a webservice and push notification. For example, when your app launch, request the webservice to send the app version and know the current version on stores. Here, you can deduce if the app can be updated and you can send push notification to alert that an update is avalaible.
Codename One provides an easy-to-use API for push notification.
However, Google Play and ITunes usually alert user that updates are avalaible.

Related

React Native - Real-time chat/push notifications on PHP/MySQL back-end

I am developing my first React Native app and are struggling with the proper implementation of push notifications and real time chat. The attached image shows the current layout without chat/notifications.
The client application uses Firebase only for social network authentication (login) and image storage.
Everything else is kept back-end using PHP/MySQL which also communicates with Firebase for session token validation and email authentication (login).
Now i want to implement a real-time chat function and push notifications but are struggling with the proper way of doing it. If i have understood correctly one way could be: Socket.io (for real-time chat using mysql for archive storage) and Onesignal (for push notifications)
Or is there a better way of doing this when using a PHP/MySQL as back-end?
Any ideas or input is greatly appriciated.

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.

can i use ionic push native without FCM?

so i have a web app and a mobile app, the web app works fine with signalR and SQL, and i'm trying to create an ionic mobile app using the same backend from the web app, so i am a little limited to using signalR as well.
in the web app, i have certain triggers set up to fire popup notifications when certain events occur, and it works great with signalR in the webapp.
the problem is : due to some restrictions i have to use ionic,and i've been searching for 3 days on a way to implement push notifications without having to resort to FCM but i haven't reached anything.
is there a way to do this with ionic 3? to implement push notifications with signalR instead of FCM?
I'm not sure I completely understand your question, but let me see if I can start a dialog.
Ultimately, for push notification, you have to contact both APNS (Apple push notification server) and GCM (Google Cloud Messaging) to enact push notifications on both ios and android phones. So, that means that you can contact the servers directly from your app. (kind of a pain for ios, not so much for android) or you can use a middle man such as:
FCM
Onesignal: https://onesignal.com/
Amazon Simple Notification Service: https://aws.amazon.com/sns/
or a bunch of others: http://www.businessofapps.com/guide/push-notifications/
I'm not familiar with signalR per se... but I'm very familiar with push notification. You can do everything you need with http api calls from signalR, but the certification requirements for the GCM and APNS servers are difficult to keep up on the app itself. (hence so many businesses that will do it for you.)
Although, I guess one thing I'm a little confused about exactly who you are pushing to... a web service? a phone? (I'm assuming a phone since you mentioned FCM)
Edit after first comment:
So, the answer (as I understand your question) is that you cannot go from signalR to a mobile device directly without using something like FCM (which I recommend) or Onesignal.
For Why... Let's start with a diagram:
You'll notice the bidirectional flow from the cloud marked APNS, GCM and FCM between the device. That means that only way to get to the phone via push notification is via APNS, and FCM, which you'll have to do through a push notification service.... such as FCM
Before any confusion sets in, let me point out some important point:
1. FCM and GCM are pretty much synonymous. FCM is the updated version of GCM that added some functionality. more info here
FCM is both a push notification service and the messaging service. That is to say that FCM provides both the services of the gray box and the gray cloud below. As far as I know, there is nothing similar in the ios world that does both. FCM allows you to pass along messages to both android and ios phones (via FCM and APNS)
So, you don't HAVE to go through FCM to do push notifications, but even if you picked OneSignal, they will still communicate with FCM to actually send out the push notification to the phones themselves.
You're doing the right thing by starting in the android world. Push notification is significantly easier there than in ios. (The difficulty lies in the certification process which is easy after you get to know it... but it was tough for me to understand at first)
In short, this is what I would recommend:
1. use ionic native push to communicate with FCM as a push notification service (the gray box)
2. setup FCM so that it can communicate with the APNS servers as well when the time comes.
for ionic native, I'd use their github site for documentation (I'm sure you've already been there) https://github.com/phonegap/phonegap-plugin-push
For setting up FCM, I'd recommend the documentation at the firebase website: https://firebase.google.com/docs/cloud-messaging/
Note: When using firebase products in ionic... choose "web" for all documentations. For example, despite the fact that you're planning on using ios and android phones, you'd pick "get started for web" at this link:
https://firebase.google.com/docs/

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.

Background task on iOS

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.

Resources