I use fcm xmpp protocol send push and Receive delivery receipt。
but starting from 2019-12-18, delivery receipts have begun to decrease, and 2019-12-20 there are no receipts at all,
I don't know why. my params no change. it's my param.
<message id='q2fcQ-183429'><gcm xmlns="google:mobile:data">
{
"delivery_receipt_requested": true,
"notification": {
"sound": "default",
"tag": "1",
"title": "title",
"body": "body",
"click_action": "push.welcome",
"android_channel_id": "notification.default"
},
"time_to_live": 600,
"message_id": "02b16456eba3483782fc471e3dd2cf73",
"to": "xxxxxxxxxxx"
}
</gcm></message>
I also ran into this problem 2019-12-20. Firebase stopped notifying delivery of notifications by the flag "delivery_receipt_requested".
See updates from 12/17/2016 FCM:
FCM has removed ongoing support for delivery reciepts via the XMPP protocol. In place of XMPP delivery receipts, developers should enable delivery data export in the FCM client SDK.
https://firebase.google.com/support/releases
Also, Cloud Messaging version 20.1.0 - https://firebase.google.com/support/release-notes/android#messaging_v20-1-0
Added setDeliveryMetricsExportToBigQuery(boolean) and deliveryMetricsExportToBigQueryEnabled() to control and query if messsage delivery metrics are exported to BigQuery.
Related
According to here,
https://support.google.com/analytics/answer/11583528?hl=en
GAU must be updated to GA4 properties. I'm using measurement protocol to send data to both GA4 and GAU properties. So in order to send measurement protocol to GA4 property should I update my existing measurement protocol apps?
I can send data to GA4 property using v=2, tid=G-xxxxxxx parameters at the endpoint /g/collect. Will any of this change?
The Measurement Protocol (Universal Analytics)
is not being updated it will probably be discontinued when UA stops recording hits.
The Measurement Protocol (Google Analytics 4) is still being developed. It does not open for all events.
const measurementId = `<measurement_id_value>`;
const apiSecret = `<secret_value>`;
fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
method: "POST",
body: JSON.stringify({
"client_id": "XXXXXXXXXX.YYYYYYYYYY",
"events": [{
"name": "refund",
"params": {
"currency": "USD",
"value": "9.99",
"transaction_id": "ABC-123"
}
}]
})
});
I'm trying to verify Id tokens received by signing in with the REST API for authentication by using the verifyIdToken(idToken) method in the Admin SDK but instead of getting the decoded token I get the error:
Firebase ID token has incorrect "iss" (issuer) claim. Expected "https://securetoken.google.com/"" but got "https://identitytoolkit.google.com/". Make sure the ID token comes from the same Firebase project as the service account used to authenticate this SDK. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.
As I said above I'm getting my token from the REST API, so I was expecting this to work.
The response I get from the API is this:
{
"kind": "identitytoolkit#VerifyPasswordResponse",
"localId": "pu0yjIc8tnR85X2gERdtLx684DK2",
"email": "test#test.com",
"displayName": "",
"idToken": "<token-id>",
"registered": true
}
Is this considered a custom token? if so, how can I verify it?
As of Sep 2018, the issuer of the ID Token returned by REST API seems to be changed from https://identitytoolkit.google.com/ to https://securetoken.google.com/. And I can successfully verify this id token in firebase admin SDK.
[Edit]: The firebase admin SDK still fails to verify the Facebook ID Token returned by identitytoolkit's verifyAssertion REST API.
According to Google Developer
Calling the tokeninfo endpoint
An easy way to validate an ID token for debugging and low-volume use
is to use the tokeninfo endpoint. Calling this endpoint involves an
additional network request that does most of the validation for you,
but introduces some latency and the potential for network errors.
To validate an ID token using the tokeninfo endpoint, make an HTTPS
POST or GET request to the endpoint, and pass your ID token in the
id_token parameter. For example, to validate the token "XYZ123", make
the following GET request:
https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=XYZ123
{
// These six fields are included in all Google ID Tokens.
"iss": "https://accounts.google.com",
"sub": "110169484474386276334",
"azp": "1008719970978-hb24n2dstb40o45d4feuo2ukqmcc6381.apps.googleusercontent.com",
"aud": "1008719970978-hb24n2dstb40o45d4feuo2ukqmcc6381.apps.googleusercontent.com",
"iat": "1433978353",
"exp": "1433981953",
// These seven fields are only included when the user has granted the "profile" and
// "email" OAuth scopes to the application.
"email": "testuser#gmail.com",
"email_verified": "true",
"name" : "Test User",
"picture": "https://lh4.googleusercontent.com/-kYgzyAWpZzJ/ABCDEFGHI/AAAJKLMNOP/tIXL9Ir44LE/s99-c/photo.jpg",
"given_name": "Test",
"family_name": "User",
"locale": "en"
}
How to send a message to the user who logged in through the telegram in website?
Telegram Login for Websites
Telegram bots are a powerful communication tool, but until today they
couldn't start a conversation. Even if you wanted them to reach out to
you, you had to chat them up first.
and
Bot API 3.6
Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
After login user,my bot can not send message with use user_id,Even the OnMessage event is not fired.
How start a conversation by bot?
Thankful.
You answered your question yourself here :
Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
More descriptions:
After the user logged in with telegram login widget,you should wait for an update event (assuming you'r using Webhook method for your telegram bot). the update body should be something like this:
{
"update_id": 290285,
"message": {
"message_id": 12,
"from": {
"id": 117854,
"is_bot": false,
"first_name": "",
"last_name": "",
"language_code": "fa"
},
"date": 1549829158,
"chat": {
"id": "you need this to start conversation",
"type": "private",
"first_name": "user_firstname",
"last_name": "user_last name"
},
"connected_website": "the domain mapped to your bot"
}
from the "connected_website" filled you can realize this is a user logged in for the first time and save the chat id to start next conversations in future.
PS : I wonder why there is no documentation about this at telegram or at least I didn't found anything.
In my case I did not receive an update event as a webhook, like Ali Titan described.
But instead chat_id came to custom onauth js funcion:
{
"id': 100102379,
"first_name": "Guido",
"last_name": "Van Rossum",
"username": "guido",
"auth_date": 1642941713,
"hash": "568a5665500a389a754a1c04348ea1c0434d4b507b1920f3ca1ff017a1c04341"
}
In this example id is exactly chat_id you are looking for.
In other words, if you want to provide it to your backend, you should write something like:
<script async src="https://telegram.org/js/telegram-widget.js?15" data-telegram-login="samplebot" data-size="large" data-onauth="onTelegramAuth(user)" data-request-access="write"></script>
<script type="text/javascript">
function onTelegramAuth(user) {
$.ajax({
url: '/telegram_widget/login/',
method: 'POST',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(user),
});
}
</script>
And then use this id to communicate with your user.
I'm using the pubsub library from an ESP8266 NodeMCU and the Arduino IDE.
https://github.com/knolleary/pubsubclient/tree/master/examples/mqtt_esp8266
My device is registered with the IBM Bluemix IoT Foundation (IoTF).
The client name I'm using is
char* myclient = "d:ORGID:Devicetype:Deviceid";
Where orgid is my orgID from Bluemix and the Device type and id are from the device I created and registered in the IoTF. The topic I'm posting to is by this line in my code:
client.publish("iot-2/evt/status/fmt/json", msg);
In Node-RED I have an IOT-in node looking at Device Status and using the Bluemix service for auth.
I am seeing this error when I put a debug node looking at the complete message object from the IoT-in node (note: I changed my orgid to ORGID in this debug output):
{
"_msgid": "9f433f7b.60bcc",
"deviceId": "InterConnect",
"deviceType": "nodeMCU",
"payload": {
"Action": "Disconnect",
"ClientAddr": "24.47.149.38",
"ClientID": "d:ORGID:nodeMCU:InterConnect",
"CloseCode": 276,
"ConnectTime": "2016-02-14T18:32:19.328Z",
"Port": 1883,
"Protocol": "mqtt4-tcp",
"ReadBytes": 111,
"ReadMsg": 0,
"Reason": "The topic is not valid.",
"SecureConnection": false,
"Time": "2016-02-14T18:32:19.397Z",
"User": "use-token-auth",
"WriteBytes": 4,
"WriteMsg": 0
},
"topic": "iot-2/type/nodeMCU/id/InterConnect/mon"
}
I'm wondering how my topic got changed to what it's showing here. Any ideas?
This was occurring because my code was subscribing to "iot-2/evt/command_id/fmt/format_string" instead of "iot-2/cmd/command_id/fmt/format_string" - once I fixed that, everything flowed fine.
I am using a HTTP post request to add places with google api in meteor js. The code I used is
var url = "https://maps.googleapis.com/maps/api/place/add/json?key="+googleKey;
Meteor.http.post(url,
{params: {
"location": {
"lat": -33.8669710,
"lng": 151.1958750
},
"accuracy": 50,
"name": "Google Shoes!",
"phone_number": "(02) 9374 4000",
"address": "48 Pirrama Road, Pyrmont, NSW 2009, Australia",
"types": ["shoe_store"],
"website": "http://www.google.com.au/",
"language": "en-AU"
}
},function(err, result){
console.log(arguments);
})
Am getting an error
{ [Error: failed [400] { "status" : "REQUEST_DENIED" } ]
I had tried with changing the params and googleKey,but there is no change in the error. Can somebody help me to use http post request with google api? Thanks in advance
Did you try data in place of params ?
Meteor.http.post(url,
{data: {
"location": {
"lat": -33.8669710,
"lng": 151.1958750
},
"accuracy": 50,
"name": "Google Shoes!",
"phone_number": "(02) 9374 4000",
"address": "48 Pirrama Road, Pyrmont, NSW 2009, Australia",
"types": ["shoe_store"],
"website": "http://www.google.com.au/",
"language": "en-AU"
}
},function(err, result){
console.log(arguments);
})
Works fine on my remote server, but in localhost I have an INVALID_REQUEST response, due to the key I think.
Based on the FAQs of the Places API documentation
The "status": "REQUEST_DENIED" is returned by the Google Places API Web Service when:
You have not activated the Google Places API Web Service in the Google Developers Console.
The key parameter is missing from your request.
The key parameter does not match the your API key in the Google Developers Console.
Your API key has not been correctly set up in the Google Developers Console:
If you are using a browser key, check that your allowed referer(s) are correct.
If you are using a server key, check that your allowed IP(s) are correct.
Android and iOS keys are not supported, please use a Browser or Server key.
The request was not sent as an HTTPS request, HTTPS is required for all Google Places API Web Service requests.
The incorrect HTTP method was used to send the request:
All requests must be sent as a GET request except for Place Add.
All Place Add requests must be sent as a POST request.
The request body you specified looks complete, you can check out the Google Developer Console if you missed some configuration on it.
Hope this helps!