Browser focus on PWA apps after sending SMS via SMS url - sms

I'm developing a PWA that exchanges public keys between friends using SMS.
The process begins with one person clicking a link to a partially populated
SMS url and opening a window - the portion of the url which is populated is
the body, which points to a dynamic url generated by the app.
For example:
"sms://&body=http%3a%2f%2facme.com%2findex.php?id=128409234823432"
What remains is the selecting of a contact from your phone book to send the link to.
The problem I am facing is the browser loses focus to the SMS app and there is no
way to programmatically bring the browser back to the foreground if the SMS is sent
or even canceled - This causes confusion for non-tech users as they think
the app has been closed.
Is there a way to return to the browser after the user sends the SMS?

Related

Google Meet integration api (like Hangouts app for Slack)

I want to utilise Google Meet api, which is used in Hangouts integration for Slack, description follows
TL;DR:
Links such as https://meet.google.com/new?gid=123&gd=qwe987 can be generated, so a modal is shown which can ask user's confirmation and then some request is sent from user's browser (where the Google Meet page is opened) to some endpoint (probably it is determined from gid which seems to be google application id). Is there a way to configure my application to have a webhook, so I can generate these custom links?
There's Google+ Hangouts app for Slack. Here's how it works (after you add the app in your workspace):
you send /hangout command in any Slack channel
slackbot sends an "Only visible to you" message in this channel with a link to start a new hangout. it looks smth like this (I changed data in the link): https://meet.google.com/new?gid=691521906844&gd=THTJ30X6W%7CU01113BD13M%7CD01113BDB5Z%7Csuren%7C%7C1846381238693%7C1%7CB01QFGG5GJF%7CE1MDm4DWcuVa0RbN5ZT9o5KF
when you visit the link, a new meeting is started instantly, and the page shows modal with text "To bring others into this video call, post a link it to your Slack channel" with buttons 'Cancel' and 'Post'.
when you click 'Post', a new message is sent to the Slack channel, where the command was sent. Text is "#Suren Khorenyan has started a Google+ Hangout and would like you to join. Join Hangout." and contains a link to the meet, which was created previously
How can I utilise this integration for another app, like Mattermost (or anything else like Telegram chats via bots)?
As I see, data in the url slightly changes. Probably it's payload for Google Meet to trigger Slack to send a message with link to the channel.
gid seems to be something like google app id
gd seems to be something like google data. If I url-decode it, it becomes THTJ30X6W|U01113BD13M|D01113BDB5Z|suren||1846381238693|1|B01QFGG5GJF|E1MDm4DWcuVa0RbN5ZT9o5KF. This is some kind of payload, separated by pipes (obviously), but I don't know what any part of this means (suren is my username in the Slack workspace, probably this is used for creating an invitation message).
When I click Post, this happens:
a new POST request to https://hooks.slack.com/services/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 is sent with form-data
hangout_id: 1812381238693
hangout_url: https://meet.google.com//abc-iuqx-def
a new message is posted to the Slack channel
Google meet somehow knows where to post back! Is this configured at the Google application (application id is provided via gid)? How can I configure my application for such behaviour? Where can I setup webhook url?
If we breakdown the request, we can see that url contains some parts of the gd payload:
THTJ27X6W - this is the first part of the gd payload
B01ABCD5GJF - last but one
E1MDm4DWcuVa0RbK5ZT9o5KD - the last part of the gd payload
and form-data contains:
hangout_id - this is in the gd payload after my name
hangout_url - obviously, this is the url for the new created meeting
How can I change it for my needs?
I created a new application at Google APIs dashboard (here console.developers.google.com/apis), but can't find any docs for this integration. There's Google+ Hangouts API in API Library, but it says Apps will continue to function until April 25, 2017..
I tried to approach it from another side:
In the API Library there's Google Calendar. I found mattermost-hangout app on GitHub (had to update it a bit, so it works with updated api). Here's how it works:
oauth2 for authorising at google (single account)
it handles POST request, which is meant to be received from Mattermost (triggered by a slash command),
creates a new calendar event using Google Calendar API (with conference),
takes hangouts url from the response and sends a new message in the Mattermost channel with invitation to join the meeting.
But it has some downsides:
you have to use one account to authorise all event creation events (yeah, it can be upgraded to authorise any number of users, but it'll be inconvenient. why to force anyone to provide access to their Google Account, when Google Meet authorisation just happens in browser, we don't need to create events)
account, used for auth, now has events in his calendar. of course, events can be deleted, but it's not the way.
Is there any documentation on utilising gid and gd params?
Generally, I want to find a way to configure a webhook in my app, so when Google Meet finds my application's ID in the gid query param, it looks at the app's config and sends a request to my app (previously configured endpoint (I assume it works this way)).
Of course there's a chance that it's some kind of internal API and it cannot be used by everyone, but I could not find any information on this.

Slack API - clicking a button in a Slack conversation sends a message on the channel

In a Slack conversation, is it possible to click on a button to send a message to the Slack channel?
The Slack conversation could be:
The user types a word (or message)
A slackbot shows some text and two buttons
The user clicks on a button to send a TEXT message to the Slack channel
The Slackbot reacts on the 'action' message.
It is not possible to create an REST service for my Slackbot, because the Slackbot is behind a firewall. So, registering commands is not possible.
So sending a message as the result of a button click is needed. The Slackbot can react on that message.
I read that attachments could be a good way to do this, BUT the is 'outmoded'.
I tried to send an secondary attachment, which is outmoded, but that was not possible.
The next approach was adding a webhook. So pushing a button resulted in using the url, but that is of course not possible because I cannot send a POST request via a simple (get) url.
Please give a short example.
This will not work.
Every interactive feature (e.g. buttons) require your app to be able to receive POST requests from Slack through the public Internet. Since you say you can not provide that (e.g. behind a company firewall) you will not be able to use any interactive features.
See also this answer: How to integrate internal APIs (Not accessible outside office network) to slack slash commands

Outlook Message webLink with ispopout=0 working only with Inbox

I'm currently building an integration with Office 365 Outlook thanks to the Microsoft Graph API. I retrieve user messages data, along with the webLink, which is a direct URL to the message in Outlook Web App.
By default, it opens in a popout window displaying only this message. My goal is to display it in the full Outlook Web App. In the documentation of a Message resource, Microsoft states this:
You can append an ispopout argument to the end of the URL to change how the message is displayed. If ispopout is not present or if it is set to 1, then the message is shown in a popout window. If ispopout is set to 0, then the browser will show the message in the Outlook Web App review pane.
Doing this works well if the e-mail is in the Inbox mail folder. However, if it is in another folder (like Sent Items or a custom one), it always redirects to the Inbox and opens the first message in it.
Is it a known limitation of this parameter? Is there a workaround to achieve this?
Best regards!

Using Phone Number to Prevent Spam: How to prevent spam on a mobile app?

Compared to using CAPTCHA, would using a phone number to prevent spam/bots improve the user experience.
I'm building an ecommerce app that does not require a user to create an account, when a user writes a product review they enter there phone number and a verification code is sent which the user sends back so that the review is successful.
It is not typical to use CAPTCHA for a app login. The better UX for app users is to get the phone number and send a verification code to authenticate if the request is coming from a real user. When an SMS arrives it normally shows up at the top (on notification window) which shows the verification code at the top. So the user doesn't even have to switch the app to read the verification code in SMS. All he has to do is wait until the SMS arrives and key in the code in your app.
There are several SMS verification API providers available to make it easy for sending out verification code.
I have used Nexmo Verify API before which makes it easy to generate the code and completes the verification.

Windows phone SMS plugin with extra functions

I'm using the code from this article, with phonegap app.
http://blogs.msdn.com/b/glengordon/archive/2011/12/02/phonegap-on-wp7-tip-3-sending-sms-and-intro-to-plugins.aspx
The plugin works all fine, but when the SMS is sent, I want to return to my app automatically. Is this possible? If its possible to send an SMS without go to the default integrated sender, it could be even better.
I'm a newbie to C# and windows phone apps - please help me ;)
there is no way to avoid the integrated SMS sender due to security reasons. User will return to your app after hitting the Back button on the SMS conversation page (that is esured automatically because of the stack-controlled nature of paging in WP7, but will not return after hitting the home button (again, this behavior cannot be prevented in any way) and your app will be suspended (possible to return to it by holding the back button and choosing it).

Resources