I am using OneSignal push notifications in my Ionic 2 app. It works fine except for the following case:
Kill the app to make sure it is not running in the background.
Send a notification to the app.
Dismiss the notification.
Open the app.
I don't receive any indication that the notification was received.
I have called OneSignal.handleNotificationReceived().subscribe(), during initialisation, but this is not triggered unless the app is running in the foreground/background.
Is there any way to get the notification when the app is started, even if the user dismissed the notification.
Thanks.
There is no way to achieve what you're trying to achieve through the use of OneSignal alone. The OneSignal plugin for Ionic 2 has two calls to action:
handleNotificationReceived() & handleNotificationOpened()
The first one is called when the notification is received and the app is in the foreground, and the second is called when the app is launched from the notification.
You'd need some other service to record when notifications are sent to see if there were any when the app was launched by itself. If you use OneSignal's REST API to send notifications yourself, you can record when a notification is sent, and then when the app is launched by itself, and not from the notification, you can fetch missed notifications or notification count from your own server. That's just one way you can do it.
But ultimately OneSignal is a push notification service, and that's all it does, send notifications. Even if you did APNS or FCM yourself and went through the scenario you outlined, the results would be the same, it's not a OneSignal issue. It's the way notifications are designed.
Related
I'm admin of my test app, and my test page.
Now I'm doing a function get page's feed realtime by webhook, just only on development mode.
When I click test button on App's Dashboard, It has been sent to my webhook. But when I comment or like ... the post, facebook doesn't send even though I subscribed feed webhook.
With Messages, it has been sent successfully, but Feed doesn't.
I ask facebook support, so they said that:
"Applications will only be able to receive test webhooks sent from the
app dashboard while they are in development. No production data,
including that of app admins, developers, and testers, will be
delivered unless the app is live. In order to receive feed webhooks,
your app needs to be live and has to go through app review for
necessary permissions."
I understand that I can not get data from facebook even though it is under development mode.
So how can I get data returned by facebook to develop, test... apps in development mode.
Thanks so much.
It is not possible to run this service without an app review, since it is not possible to add the 'mange_pages' permission to a (test-)user within a development app. At the same time it is not possible to turn a testapp into live-mode. As the same is true vice versa the only solution is the app review to get information from a specific (test-)page.
For live testing i suggest to create a testuser and subscribe for information about the "user" to test your webhook.
You can check with GET graph.facebook.com/app-id/subscriptions, if your app is successfully subscribed to "page information". Graph API Documentation
As you already mentioned you can also send "page information" test calls to your endpoint.
UPDATE 18th Nov 2018
If you go to Webhook -> pages in your App Dashboard on https://developers.facebook.com you are able to notice, that Webhooks in dev mode do not work.
I've submitted a Bug report to Facebook for this issue, as there is no proper solution.
You can check it at : https://developers.facebook.com/support/bugs/1570460936387604/
I also don't get the fact that you can't test webhooks in dev mode, and you can't do the app review because you can't develop your app and show them for review.
Just a chicken and egg issue.
I'm implementing an application on iOS which main purpose is to handle push notifications received from the server. Server is using GCM for messages delivery.
If I decided to use the FCM framework on iOS (not even decided, just haven't found GCM framework for Swift 3, nor on Cocoapods), how much compatible will it be with the existing GCM - is it necessary to migrate it to FCM?
Is it possible to receive data messages (not notifications - the work as the should) while application is terminated. While application is in the background or foreground, the delegate method is being invoked and data are handled as they should, but when it is terminated - nothing is invoked, only if user touches the notification popup, but I need to fill data from data message to the database even when app is closed.
How to determine the topic to which the message was sent?
The reason I need this is that I have to make different actions based on to what topic/s the received message was sent to. I know that on Android, there is a key in received JSON - from, but what about iOS?
Thank you.
All the GCM features are compatibile with FCM (same token, topics etc).
New FCM features might not be available in GCM.
On iOS is not possible to receive data-messages if the application is terminated (as in it's not listed in the app switcher menu). This is a limitation imposed by iOS.
for now I suggest to add (replicate) the information about which topic you are targeting in the the data payload of the message
Is it necessary to migrate it to FCM?
YES, and here is the guide that can help you to migrate a GCM Client App for iOS to Firebase Cloud Messaging
Is it possible to receive data messages?
Try to check this page to know how the FCM message work. You can learn here all the possibilities that you can do with your message in FCM.
How to determine the topic to which the message was sent?
Now, for this question, this Topic Messaging on iOS guide can help you to answer your question.
Hope this information helps you.
I have my Django Web app and I want to make a mobile version but it will take me a while, so, I would like to know if it is possible to send push notifications to the mobile phone (either Android, Apple) from the webapp.
The client will run the website normally from the phone and I would like to send a notification when the process made is finished. How can I achieve that ? Do django signals have the effect of push notification ?
Thanks
You can connect QuickBlox to your app and that would be a way to go.
Here's the tutorial for iOS: http://quickblox.com/developers/SimpleSample-messages_users-ios
And this one is for Android: http://quickblox.com/developers/SimpleSample-messages_users-android
Hope that helps.
I need to create simple web service application. I need to show message box on the pc that runs that service. Is it possible to ask web service to create message box?
No, thats Not possible. But you can create a client application, which consumes that service. Check the condition and display the message box.
Say, I have a Windows service application and also windowed client applications running in each logged on user session. If I call RegisterWindowMessage in each client app and try to trap that message there. And then also call RegisterWindowMessage with the same message name in the service app and then use it in a call to SendNotifyMessage again from the service to notify each client app of a single-fire event, will that work?
PS. I program using C++/MFC and native WinAPIs.
If your service application is running under the system account it cannot send messages to the user account's application.
Your can try the following approach:
Go through all the sessions (WTSEnumerateSessions) to get all
WindowStation,
Open these stations (OpenWindowStation),
Per station
Associate your process with the station (SetProcessWindowStation),
Go through all station desktops (Enumdesktops),
Go through all windows (EnumdesktopWindows) until your found one of your
application's window
You probably will have issues with UAC though.