How to send parameters in push notifications? - xamarin.forms

I'm trying to send some hidden parameters along with the notification message sent to the user, used to open specific form with specific ID.
I know we have "tags" to categorize the users we want to send the message to including the userid.
That's not what I need.
What I'm looking for is:
after the push notification is sent to user, I need my app to able to read some parameters used to open the right form with the right data displayed in.
Any idea? Thanks!

Related

How to send an Attachment in Google Chat via Bot/ Webhook

My organisation is using Google Chat for internal communication. In one of the group in the app I am sending the report of daily automation test run using webhook. Currently the report consist of only text message containing the pass/ fail count.
But I want to send the html report as well with that. I could not found any source which tell the information about how to send the attachment in the bot messages in Google chat.
Please help me if someone knows how to send the attachment report using Google Chat Bot or Webhook.
Per documentation, Bots have limited message types they can send. (Only simple text, or Cards)
I would suggest sending a link to download the report, which is feasible with the bot. See Including links in message text

Flutter: Sending Email Verification code through FlutterFire?

In the FlutteFire documentation, it says that "Firebase will send an automated email to the user with a unique code. This code can then be entered via the applyActionCode() method. You can first check whether the code is valid by using the checkActionCode() method" Yet when I send an email verification, it shows a link.
In my email template on Firebase console, it is still showing an email link.
I want to be able to send a code instead, just because it allows for a better user experience in my opinion. What do I do in order to get the email verification to send a code instead? I've looked everywhere and can't find anything helpful.
At the time of writing, you cannot extract the oobCode value that is generated by Firebase Auth.
If you want to use this code, you need to extract it from the Query String in the web page that corresponds to this URL (note that you can adapt the URL in the template in order it points to another URL that you control, e.g. that is exposed by your app).

firebase https link to change realtime database

Does anyone know if Firebase has the functionality for me to email a user with a yes/no question which in turn offers two links, if one of those links are clicked it then changes a specific value on a node in the database?
In my mind I would use a firebase function to email the user when a certain trigger occurs, and the body of that email would be a template where upon the two links can be added as needed.
I have been searching online but either am using the wrong key words or the functionality does not exist..
Yes, you can do this with Cloud Functions for Firebase. Essentially you would want to have two functions: one that sends the email and one that handles the links in the email.
If I were building it, I'd probably generate a secret token when I sent the email and store it along-side the question's data. In the email template, I'd then have the yes/no buttons point to my function URL like:
https://us-central1-myproject.cloudfunctions.net/respond?answer=yes&token={the_generated_token}
I'd then parse the answer and token from the query string in my respond function, verify that the secret token matches, and if so record the response. Once the response was recorded, I'd invalidate the secret token somehow so it could only be used once.

How to echo message at telegram /start?

I'd like to set up a authentication through telegram using it's deep linking api.
In order to authenticate, in my app I ask users to click on a link like:
https://telegram.me/myloginbot?start=somesecretkey
If I understand the docs correctly, I should expect the bot to echo back somesecretky to my server.
Now, this step of the docs is unclear to me:
Configure the webhook processor to query Memcached with the parameter that is passed in incoming messages beginning with /start
If I understand correctly, I need to configure myloginbot so that when the user clicks start button on the bot's page, the bot echos back to my server a url containing somesecretkey and some user info. But I don't know how to do so.
In this answer, it is suggested that:
Let the bot retrieve the username by querying the database or key-value storage for unique_code.
But I don't know how can I make the bot query the (presumably remote) database.
So really appreciate your hints.
My understanding to deep linking is this:
You have a database of users. Each user has an ID. Suppose you want your Telegram bot to communicate with user 123. But you don't know his Telegram chat_id (which the bot needs in order to send messages to him). How do you "entice" him to talk to the bot, thus revealing his chat_id? You put a link on a web page.
But the link has to be "personalized". You want each user to press on a slightly different link, in order to distinguish them. One way to do that is to embed user ID in the link. However, user IDs are not something you want to expose, so you generate a (temporary) key associated with each user ID, and embed that key in the link. For example, user 123 has the key abcde. His personalized link will be:
https://telegram.me/myloginbot?start=abcde
Someone clicks on the link, and is led to a conversation with your bot. At the same time (or when he presses the START button), your bot will receive a message:
/start abcde
On receiving that message, the bot sees that abcde is associated with user 123. Telegram chat_id can also be extracted from the message. Now, the bot knows user 123's chat_id, and can send him messages afterwards.
To experiment with deep linking, you need a bot that can handle /start messages, supported by a "datastore" that remembers the key-ID associations. When Telegram docs say "memcache", they just mean something that stores the key-ID associations. For an experiment, it may be as simple as a dictionary, or an associative array. In real life, it may be Memcached (the memory caching software), or a database table.
If you use Python, I recommend taking a look at telepot, a Python framework for Telegram Bot API. It does not do deep linking per se, but it does help you in receiving messages for a bot, and other bot operations in general. I also have an example there demonstrating how to output a personalized link, set up a webhook, and parse the incoming /start command with the key.

Phonegap Push Notification redirect to specific page in the application when clicking

Using Phonegap Push Notifications Plugin to build a mobile application for IOS and Android, how proceed to let the notification received redirect or forward to a specific page in the application when the user clicked it? i.e. when receiving the notification, the user must open it to see it, we need to forward the application to a specific page, like notifications.html?id=USER_ID?
Is that any way to send the parameter USER_ID with the message pushed , The issue could be resolved in this case...
Thank you for your suggestions...
When you sent a push notification from your server includes an extra value name id.
When the notification is received then save the value of this "extra value" id using localStorage.setItem.
then inside onresume event reads the value of this id using localStorage.getItem, and according the value open the respective page using $.mobile.changePage( ...);
for detail check this :
https://github.com/phonegap-build/PushPlugin/issues/213

Resources