web push on mozilla with group ids - push-notification

Could I send message to Mozilla push service endpoint with group ids, which like Device Group Messaging of FCM ?
/*
some code like :
"registration_ids": ["4", "8", "15", "16", "23", "42"]
*/

Mozilla autopush is a standard push service and currently the W3C Push API doesn't support groups or segments.
The only options are:
manage segments by yourself
use a service which adds an additional layer of abstraction and supports groups and tag-based routing

Related

Get notification (message) to web using JavaScript

I am using firebase to send notification (using token) to both android and IOS and applications are working fine. Now my requirement is:
When apps receive a notification, that time notification is also received in web application.
How it is possible, suggest me.
Thanks.
I am using code by using link:
https://rakibul.net/fcm-web-js
but this is work for browser notification.
Sending is the same.
If you have some account for each user, you can group them under the device groups and then send it to all of them at one time.
Frontend is same as in your link.
By https://firebase.google.com/docs/cloud-messaging/android/device-group
create device group
https://fcm.googleapis.com/fcm/notification
Content-Type:application/json
Authorization:key=API_KEY
project_id:SENDER_ID
{
"operation": "create",
"notification_key_name": "appUser-Chris",
"registration_ids": ["4", "8", "15", "16", "23", "42"]
}
This returns you notification_key, which you can save to your users account.
If you want to add another device for the user, call
{
"operation": "add",
"notification_key_name": "appUser-Chris",
"notification_key": "APA91bGHXQBB...9QgnYOEURwm0I3lmyqzk2TXQ",
"registration_ids": ["51"]
}
And you can then send your message to the notification_key insted of registration_id.

ApplicationError: LinkId(s) specified in request are not available

I'm using the HERE Route Match Extension API for matching GPX Data to a route. Afterwards, I am using the road links from the matched route for querying the Routing API. This worked perfectly some weeks ago; strangely I am now getting this error for some of the road links from the Route Match Extension API (response from the Routing API):
"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "LinkIdNotFound",
"details": "LinkId(s) specified in request are not available",
"additionalData": [
{
"key": "LinkId[0]",
"value": "-1224766809"
}
]
In the response from the Route Match Extension API, the road link definitely exists:
{"confidenceValue":0.6,"elevation":188.39999999999998,"headingDegreeNorthClockwise":10000.0,"headingMatched":118.0,"lat":49.67599245719612,"latMatched":49.67605,"linkIdMatched":-1224766809,"lon":10.035531716421247,"lonMatched":10.03558,"matchDistance":8.36,"matchOffsetOnLink":0.6588415883643146,"minError":1000000.0,"routeLinkSeqNrMatched":178,"speedMps":0.0,"timestamp":1532677148000}
Here is an example query link for the above error: https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!49.77763,9.95697&waypoint1=link!-1224766809&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary
What's going on here? Is this just a temporary issue, since it used to work some weeks ago?
Underlying map release for RME and routing api could be different which leads to link id in both not matching. It is recommended to use lat, long for the routing api.
Routing api and extensions api map release cycles are different and you wont be able to change them. It is better to use the lat, lon rather than relying on link id for your usecase. Using the lat, long from your rme response I get a different link id in routing api. https://route.cit.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!49.77763,9.95697&waypoint1=geo!49.67599245719612,10.035531716421247&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=<>&app_code=<>&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary

iOS FCM data only message does not call messaging:didReceiveMessage

Firebase Messaging version 5.6.0. I am attempting to handle a data only message in the foreground via Firebase Messaging on iOS 9.0 (10 if needed), but it is not calling FIRMessagingDelegate's messaging:didReceiveMessage per the documentation. I see the message come in # FIRMessaging.m's appDidReceiveMessage:message, but never comes through to the delegate.
This is the snippet from the cloud function that sends data to the topic per sending to a topic:
const message = {
data: {
test: '123'
}
topic: 'example'
}
admin.messaging().send(message);
Did I miss something?
Update: I do receive the data if I implement application:didReceiveRemoteNotification:userInfo
fetchCompletionHandler:completionHandler.
Thanks to Kat at Firebase support, here is the answer.
Use legacy sendToTopic instead of send, as send quietly adds content_available=1 which gets treated as APNs silent notification. Here is the updated version:
admin.messaging().sendToTopic('example', {
data: {
test: '123'
}
});
// Always use strings for key/values in the data object.
Below verbatim from Kat at Firebase support:
How the FCM data message is handled would depend on your setting for content_available.
If you have content_available = 1, the message is sent via APNs and is treated similar as an APNs silent notification. This is handled in the application:didReceiveRemoteNotification: callback when the app is running in foreground or background (i.e. not killed). See this related StackOverflow post for more information.
Without content_available, the message is sent via FCM direct channel. This only handled in the messaging:didReceiveMessage: when app is in foreground.
Note that messages sent via the Admin SDK's send() method uses the FCM HTTP v1 API which have content_available=1 by default, so they are always sent via APNs. If you want to configure the content_available field, you'll need to use the Admin SDK's sendToDevice() method which uses the legacy protocols.
In addition, here is the list of legacy protocols.

Google Analytics' push not received on Drupal Commerce

I've read a lot of people having this problem on tracking orders' event on Drupal Commerce site, but I didn't find any convincing reply according to my context. That's why I'm asking here for help.
First of all, here's what I can say about the context i'm working on :
Drupal 7.43 with Drupal Commerce
GA, Commerce GA, and GA Push modules are installed
I can receive tracking datas from visits, pages viewed, etc
For commerce tracking, I tried the 4 sending methods (JS, SSGA PHP, UTMP PHP, UTMP JS), and none of it worked
The Rule triggered for sending data to GA is working (I tried adding an email sending to the Rule, and I received it)
If I manually type this script, I can see data on GA :
(in Chrome's Developer Tools)
_gaq.push(["_addTrans", "578", "Patrick Frey", "56", "0", "0", "Paris", "", "France"]);
_gaq.push(["_addItem", "578", "130", "Test", "No category", "10", "1.00"]);
_gaq.push(["_addItem", "578", "shipping", "Free shipping", "No category", "0", "1.00"]);
_gaq.push(["_trackTrans"]);
Is someone have an idea of what's going on with my GA Pushs ? I'm working on a production site so I can't really try, but if someone have an idea of how i could debug this, this would be great !
Thanks,
Tristan

Can I add elements to the aps payload sent by the Bluemix IBM Push Notifications service?

I'm successfully using Bluemix Push to send notifications via the REST interface to an iOS app with a simple string alert message. That works fine.
Now I would like to send a more complex message where alert is a dictionary and has a sibling "category" element per The Remote Notification Payload.
Is this possible with Bluemix Push? Whenever I try to deviate from the basic structure, I get "Bad Request - Invalid JSON".
After much head-scratching, I finally picked up a hint from https://www.ng.bluemix.net/docs/services/mobilepush/t_advanced_notifications.html#t_push_badge_sound_payload and figured out that since the category field is unique to APNS, what I needed to send is
"settings" : {
"apns" : {
"category" : "myCategory"
}
#DSchultz_mo I was having issues to find the documentation but I finally found it, so if you go to https://mobile.ng.bluemix.net/imfpushrestapidocs/#/ you can use swagger to register your device and send notification and the magic button is in model there is more details for sendMessageBody

Resources