I want to write a simple javascript plugin that can send pubsub messages from the browser. But because these clients may not be (or may not want to) log in, I would like to have the plugin be able to send pubsub message unauthenticated. Is that possible? If not, what would be the best way to achieve this.
The specific use case here is: writing an web analytics plugin that can track something like page load and other events.
Sending pub/sub messages would require one to be authenticated against the project where the topic was created. Your client logging into a Google account would not be relevant unless you planned to give every user of the page access to your project.
What you probably want to do is have a service running that is authenticated to publish messages. Requests from the browser would be sent unauthenticated to this service and then you could publish a message (after some verification that it is a legitimate message, I expect) into Google Cloud Pub/Sub.
Related
I am developing a React native application where I want to sent an SMS for OTP. I used AWS SNS for publishing messages after subscribing them to a topic, but I found that the price is quite high since the SMS is transactional.
I wanted to use Firebase Messaging Cloud since they do it for free but I don't really know how to proceed with it. Do I have to createPlatformApplication and then do createPlatformEndpoint for every user to send messages? This is a bit confusing for me, so if someone could give me an overview of the initial processes, it would do me wonders.
This is how I am doing it now simply using subscribe and publish:
I understood your question as asking how you could deliver OTP codes using push notifications.
To do that, you would:
Set up a platform application through SNS: https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-register.html
Create an endpoint for each end device you want to send these notifications to: https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html
Do a direct publish to that endpoint to send the notification only to that person: https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-directmobile.html
For this use case, you do not need to use topics and subscriptions, since all of your messages will only be targeting one person.
I want to develop a web-based chat conversation. I have a Dialogflow webhook that is up and running and that can be easily integrated with, say, facebook messenger or whatsapp, thanks to the functionalities of Dialogflow itself.
Now, say I want to have a web-based chat plugin that I want to interact with said Dialogflow webhook. How does that work, in terms of setup? There are things I know I need, I would like your help to identify things that are still missing and to help me put them all together (conceptually).
I need something to make the chat conversation look pretty; I was hoping there would be some chat plugin online to style messages but the things I could find are always more complicated than that and have functionalities for you to set messages for the plugin to send automatically and things like that.
I need something that is triggered when the user sends a message; when the user sends a message I need to send it to Dialogflow in order to have it fulfilled. Can this be done directly from JS? Or do I have to send some request to my server, which will then call Dialogflow and return the user message?
Is this all I need? I am sorry if this question is too confusing or broad, I'll be glad to give further clarifications as needed.
I think you need this.
https://cloud.google.com/dialogflow/docs/quick/api#detect-intent-text-nodejs
When you use the API for interactions, your service interacts directly with the end-user. For each conversational turn, your service sends end-user expressions to Dialogflow by calling the detectIntent or streamingDetectIntent method of the Sessions type. Dialogflow responds with information about the matched intent, the action, the parameters, and the response defined for the intent. Your service performs actions as needed (for example, database queries or external API calls) and sends a message to the end-user.
It just API interaction with your chat client, you can design the way you want.
I am making an app that will preform several functions at once, the functions are sending an SMS and posting a message to Facebook and twitter
however, I have hit a wall, I can not find any information on how to automatically post to Facebook and Twitter and send an SMS.
I do not want the user to wait for the SMS messenger APP to open then tap send, then wait for Facebook to open then tap send and then wait for twitter to open and then tap send.
I want to send an SMS and Post to socials all at once.
is there any solution or advice for me and where to look.
I am using the IONIC shareSocials Plugin.
The only way would be via API integrations (but still..)
Remark: This would require the whole package..
Registering and setting up your app-clients for both FB and Twitter to allow integrating with their API's and allowing users to authenticate;
You'll need to implement the user authentication within your app to get their tokens after authenticating;
Handeling the auth-tokens in a secure way;
...
Below are the related API sections.
Twitter:
https://developer.twitter.com/en/docs/tweets/post-and-engage/overview
Facebook (only allows publishing to pages, not sure if there is still a way to post something to a user's feed):
https://developers.facebook.com/docs/graph-api/using-graph-api/#publishing
If you want SMS to be automated as well, you could look at SMS gateway API's, but these are not free (for large amounts) and are sending from a "general" number, not the user's number.
Example: https://gatewayapi.com/
If you will take a close look at those APIs you will see, that they return a page in response. This happens for a safety reason, this way they assure, that your data wasn't stolen. If the credentials are there, you go directly to the "message" view. But it is also another level of control, and posting without user interaction is a policy violation.
There was a way to post something without user interaction with opengraph, but now they are even more cautious about such things. That is also against their policy, which was recently renewed.
I'm have a personal website and I think it will be perfect if I add the push notifications feature.
I'm new to service worker, but already know about push notification. I need the service worker that send push notification even the user isn't on my website.
How do I do that? I won't use a pay service like pushcrew. I want learn how to create it.
First of all. You'll need to host your website on a secure i.e. HTTPS domain. You could use GitHub Pages for the same. It is free and easy to use.
Then you could go over this documentation. It is pretty straightforward.
Here is an awesome demo/sample.
To give you a head-start, service workers are separate js files that are registered with the user's browser. After the user is registered and subscribed a URL is generated which can be used to invoke the user's browser(serviceworker.js) (These will be invoked even if your website is not open). So you are supposed to communicate that URL back to your servers for all the users and invoke all those URLs if you are sending a push-notification to everyone. Cheers!
I have an idea for a Minecraft plugin which will allow users to log into the website associated with the server without requiring registration, all they would require is their Minecraft username.
I'm trying to find the best way to get Auth0 to authenticate users through a custom passwordless strategy, instead of the default email or SMS which Auth0 provide.
The context which I'll be using this in is as follows:
Minecraft username is entered as their login on the site > Magic link is sent to their text box in-game through a custom plugin and listener > User clicks on the magic link and they are authenticated using Auth0 (JWT token for 30-ish days).
Does this sound possible? or is it wishful thinking.
I know I'll need a custom listener to look for requests from Auth0 and something to return the magic links to the user in-game through a java plugin.
I see no reason that it wouldn't be possible, but there are a few factors to take into consideration:
Minecraft chat cannot be assumed private and direct. There are chat logs and plugins that can intercept your messages. Passwordless auth is like communicating a one-time-use password, so why would you send it via insecure means?
If we assume it's secure, typically it's the responsibility of the user to store the JWTs. If this is a vanilla client, you have no method of storing data on the client, so in the end the server is managing JWTs, which kills the entire reason to use them. Otherwise, why not just have the listener add the player to, say, a cache that expires Players after 30 days of not being accessed?
Other than these two kinks that can be worked out, it sounds like a cool idea. Good luck with it!