I'm using Plot Projects service to send geofencing notifications to users of iOS and Android application.
There seems to be a strange situation occasionally happening, that the notification linked to exit event on geofence does not get triggered. User enters the geofence, gets the enter notification (which is obviously a different notification than the exit one, but on the same geofence and with the same configuration except for the trigger and custom data), but after leaving the geofence the exit notification does not get triggered.
I'm using Notification filter, so that the application, when receiving the "silent" notification, contacts the back-end (by making an API call), and depending on the response it shows the notification or ignores it.
Although the app logs are not accessible at the time when this happens, what can be deducted from the back-end logs is that the call has never reached the back-end API. This would mean that the "silent" notification has either never been triggered (meaning that the geofence exit was not recorded by Plot Projects SDK for some reason), or it has been triggered but for some reason not handled properly by the app. Having in mind that I do get proper exit notifications occasionally, I'm not sure an in-app problem could be causing this.
Looking at the Plot Projects dashboard, I see that enter notification has been triggered once, while the exit has not been triggered at all. This is on Notifications screen, under Sent column.
As noted, the only difference between configuration of enter and exit notifications is the Notification trigger setting (On entering as opposed to On exiting), and the custom data which is as follows:
{ "geofenceId" : "{geofenceid}", "action" : "enter" }
{ "geofenceId" : "{geofenceid}", "action" : "exit" }
Both notification also use segmentation, with the segmentation configuration being the same.
So, several questions here:
Has anyone encoutered a similar problem, and what has been the cause/solution?
When using notification filter, will the column "Sent" show the number of notifications that were shown to the user, or will it include count of "silent" notifications? (this may help deducting what the issue is)
Is there a reason in general why an exit notification may not trigger, depending on some specific conditions regarding the enter notification or other parameters? For example, 3G connection issue, network issue, etc.
The latest version (1.15.0) has improved on this making enters and exits more consistent. I would recommend using that version when testing exit notifications.
Because of limitations related to efficiency and platform there will always be a small difference between the number of sent enter notifications and the number of exit notifications.
When notifications are filtered out using the notification filter they aren't included in the notification statistics. For silent notifications geotriggers may be more suitable, as those can be used silently while still showing up in the statistics.
Various reasons could prevent notifications from being sent, for example when the device is no longer able to determine its location.
Related
I am using Firebase with OneSignal within an hybrid application (Android + JS with cordova app). In some cases the user may become offline and online while he is still using the application.
Note that you can't retrieve a push notification if you don't have connectivity.
So my question is, is it possible to retrieve a push notification if the another user sends a push notification while the first user is offline, and later on this first user retrieves the connectivity (As a delayed push notification)?
Thanks!
Internally, OneSignal uses Firebase Messaging Service, so the constraints should be looked for there.
Firebase has 2 types of pushes: notification messages and data messages. That matters if you want to show a notification straight when a push comes, or you'd like to do some additional processing beforehand.
Then, you can configure Firebase to store and resend every message up to 28 days. Of course, losing a network connection for some time does not prevent a message to arrive.
There is another limitation though: up to 100 messages can be stored per client. So, if there are more than a hundred, it's better to re-request the diff.
And then, when the device finally comes back to the network, you should decide if you'd like the notification to come immediately even if the app is already minimized or the device is sleeping. Here is a part about push priorities.
Finally, to be able to work with Firebase on this lower level, you may need to configure OneSignal accordingly. Here is an instruction telling how to work with the background notifications, if you need them.
I'm deploying an app with Ionic framework. The app basically need to receive push notifications based on (specific) user position. Those notifications are location dependant, so I'm trying to figure out if it's possibile to retrieve current user location without ask the user to run the app.
I know that push notifications are received even if app is not running, what I'd like to do is to show notifications only if the user is in a specific area.
Thanks
I know that push notifications are received even if app is not running
That's not true. Push notifications let your application notify a user of new messages or events even when the user is not actively using your application, but application must be started and running in background.
You must perform 2 different actions:
Execute app on startup to allow it to perform actions needed.
Use GPS in background to know when device is in the desired position to notify.
I want to build a geofence app with cordova for android. The app gets the geofences from a server which are dynamically created by other users (in another app). These geofences last about 2-3 hours. When the user enters a geofence, he should get informed with a notification.
So far I have found two different ways / plugins which I can use to get the job done:
Track geolocation with BackgroundGeoLocation and send current position to server. The server saves the location and checks if the user enters an active geofence. Then it sends a push notification back to the user.
Use the Geofence plugin. But I don't know how to push new geofences from server to the app. The PushPlugin is not able to push silent informations when app is in background.
So, the first solution consumes more network traffic than the second one, but lets the server do the geofence work.
The second one communicates with the server just when it's needed, but there seems to be no plugin which does background silent data pushing. I have to write my own plugin then (unexperienced in java).
Which way would you recommend, or do you have other ideas to solve that problem easier?
You can use the pushnotification plugin, but will need to edit the GCMIntentService file for the plugin. You will also be able to determine when the silent action should be triggered based on the message information received and the current state of the app.
I have a Worklight app that receives push notifications from the server. A notification means there are new messages for the current user from other users. A user would read them by visiting a messages page within the app and then proceeding to a particular conversation page.
I would like to differentiate in the code between user intentions. The app would:
If the user started the app normally (not by tapping a new notification), present the user with the regular app home screen.
If the user started/resumed the app by tapping a notification, present the user with the messages page.
If received while the app is on foreground, only update the on-screen message count (regardless of which page is active).
The question is: is there a reliable means to differentiate between the above conditions?
In another thread, I saw a suggestion to remember the timestamp of a resume event and an onReadyToSubscribe event and assume we were asleep/inactive if notification arrives e.g. just a second after this. This would enable me to differentiate between 2 and 3.
However, 1 is not covered by this. I.e. if there have been new messages, but the user started the app normally, the app would have no means of knowing this and would think it was started by tapping a notification. This way, the user intended to see app home screen, but we transfer him to the messages page.
Is there a reliable way around this for both iOS and Android?
Worklight vesion 6.2.0.00-20140922-2259.
In a pure Native application, you can know "where from the user opened the app", meaning whether it was by tapping on a received notification or by tapping the application icon.
In a Worklight-based Hybrid application, and if using only the JavaScript API, this is not feasible because all paths arrive to the same destination which is the pushNotificationReceived function. So whether you tapped a notification or the app icon or brought the app to the foreground, the aforementioned function will be invoked.
The solution may be to base your implementation on the following Knowledge Center documentation topic: Using native and JavaScript push APIs in the same app.
This way, using a combination of native code and JS code, you could handle the scenario where a notification was received but the user decided to tap the application icon rather than the notification.
An end-to-end example would to somewhat involved to implement, but if you'll follow the code examples in the documentation topic, you should get there...
I have an app which is on Android and iOS. I have added a local notification to fire every 24 hours at a time specified by the user of the app. In Android, the local notification functionality is exactly what I need, but in iOS it seems to lack the functionality I need, unless maybe I am missing something...
Lets say the user sets the time the notification is to fire to 11:00am. In Android, at 11AM, it will wake up the app, go to the broadcase receiver and I am able to run code in a method that calls out to an API to fetch the latest data. Once it gets the data, it posts the notification to the user.
In iOS, it seems the data being posted to the user has to be pre-scheduled. So I have to create the notification message during scheduling of the notification. What I need is to be able to do something more like the above example.
So the problem is that at the time of when the notification is scheduled to fire, I need to check for fresh data, not the day before...
Any suggestions?
The same functionality doesn't exactly exist on iOS.
You can setup a local notifications using the functionality of a UILocalNotification object. With this you can set fireDate, etc. which is sort of like a push notification without a server. You can send a message, add a badge on the app icon, play a sound, etc.
Now the issue is that the app doesn't get launched by the OS. The app simply registers a notification in the OS, which is then handled at the fireDate time. This means you won't be able to have a chance to check for data and verify whether to continue with the notification, etc.
UILocalNotification Class Reference