I'm writing a Telegram bot in Python that sends back from a /start command a button that when pressed, it should open a web app. Nothing so complicated so far. The problem that I'm having is that the web app ( a simple HTML file ) opens fine on the desktop version of Telegram ( Telegram web ) but it won't open on a mobile device. I tried more than one device. I must add that a demo Telegram web app ( Durger King ) runs fine in every mobile device and the desktop version.
The web app is just an HTML file hosted in an HTTPS server. In my case, this server runs on the same computer together with the Telegram bot. That shouldn't be a problem but I mention it just in case.
If I send the url as a message to some user in Telegram, the page can be opened by Telegram on its embedded browser ( or any other for that matter ) perfectly well.
I tested different python bot libraries and different HTTPS servers. The only thing that can be a problem is de SSL certificate. I generate certificates using Letsencrypt - Certbot. I have used it for a long time with no troubles at all. The certificates are perfectly legal.
What can be the problem ? I'm open to suggestions. Thanks!!
As mentioned here connect your device to PC/Laptop and debug it from chrome://inspect/#devices. Then navigate to the console tab and see if any error has occurred.
Related
I see that desktop apps like discord or chrome can talk to their servers without me having to port forward anything, the server can send them information and they send information back, how is this done? I have been searching for about 2 hours but I am very new to this and don't know any of the proper search terms.
I'm trying to build a notification system that would be triggered initially from an api call made on the cloud, and should trigger a notification on one of my agents' pc (assuming running windows 10)
I'd like to do that in python as this is my knowledge
How should I structure this ?
The hardest part I can't figure out and couldn't find anything online is how to link the "local" pc to the "server"/cloud system (i'm using aws if that is useful) which would store the notification and dispatch them for each one of my agent.
My ultimate goal is to use a phone solution like aircall and to show the contact name of the caller through a notification popup in windows (aircall does offer that natively but can't access my contact datrabase so i'm trying to override the same function of displaying the caller name)
any help or suggesiton appreciated
One solution could be to build a simple ElectronJS frontend app that runs on your agents' computer AND a Python web server that listens to Aircall's Webhook events.
The web server would listen to call.ringing_on_agent Webhook events sent from Aircall and send a WebSocket push event (using Pusher for example) to your ElectronJS app.
The ElectronJS app installed by your agents would listen to WebSockets from your Python web server and would trigger a native Windows notification with the information you want (check the doc here).
Is there a way to make python receive a web push notification like a browser ?
I have a web page with Firebase cloud messaging subscription service ( FCM JavaScript client )
I need to somehow receive notifications on my python program running on windows pc
one idea was to opening a selenium chrome browser and receive notifications trough that but I didn't find a way to receive data from notifications , also I'm trying to log all windows notifications with Auto Hotkey and read the log file for my purpose but neither if this methods are time and resource reasonable
so is there any way to achieve this purpose ?
I've coded a Telegram bot (python-telegram-bot) and I would like to know if there's a way to open an app from the bot.
To be more accurate, the bot searches torrent links and the original idea was to send that links directly to qBitTorrent in the user's computer but unfortunately I'm stuck in that step, so for the moment I though about give the user the magnet link so it can be pasted in the qBitTorrent app. The thing is that it would great to automaticly open the app from the bot.
Thanks in advance!
A bot can't open an external app
I've also stuck on this problem. I've tried to open another app via URI, for example:
things://add?title=My%20new%20task
The example above shows my try to open the macOS application called Things.
The main answer is: Telegram doesn't allow to open external applications from bot and doesn't allow use any protocol in URI, except for http and tg.
I think, you can use 3rd-party (or your one) service, which will redirect you on any page that you will ask. Your URL may be a URI to your app: your mobile/PC browser can redirect you directly to the app.
Generally speaking, you're right: one Android app is able to start another app.
However, in this case, this is not your app, we're talking about, but you want another app (Telegram) to open another app. So you have to rely on what that app (Telegram) provides you with their API.
You can have a look at Telegram's bot API at https://core.telegram.org/bots/api There is no method to execute commands or open another app. So it will not be possible for you to open another app with your Telegram bot.
I was also trying to do this, but that was not possible. But as workaround you can make a simple site that opens the app and make Telegram open that.
I am using windows 7 and python 2.7
I am using Custom url for launching an app.
First I am opening a web page of BOX asking for user credentials for authentication. In the url, made redirect_uri = customuri://box_auth.
So, BOX sends the success code to this redirect uri which launches app customuri.exe.
But I am getting a shield icon Insecure content appearing in the address bar of my Google page
Hovering over the shield gives "This page includes script from unauthenticated sources."
On Inspect Element it shows,
https://app.box.com/api/oauth2/authorize?response_type=code&client_id=opun9…yt6q707s=authenticated&redirect_uri=curlargu://box_auth' was loaded over HTTPS,
but ran insecure content from 'customuri://box_auth?state=authenticated&code=TZzZhJwlw4AbWcn5FgxvpBz5H':
this content should also be loaded over HTTPS.
As custom url app should be launch with customuri://box_auth in chrome browser over https.
So, how to handle this issue. Issue is with chrome only, firefox and IE working fine
customuri:// will launch an appplication as custom url. This application I had written in python language and then converted into an exe file. I had mapped customuri with the location of this exe file in registry
The issue is non-secure scripts being run inside secure pages and is documented by Google here:
https://support.google.com/chrome/answer/1342714?hl=en
As a user, you have the choice to click the shield icon in the browser bar and run the non-secure scripts or not. As a developer, you need to ensure your scripts inside secured pages are also from a secured source.
This occur when your page embed HTTP unsecured Content/Scripts into HTTPS secured environment and might be the SSL certificate is configured on Load-Balancer not application server therefore, the traffic is encrypted up to the Load-Balancer, then it’s in clear between the Load-Balancer and the application server that called SSL offloadingso i think you will require to enable mix contents in IE or load unsecure scripts in Chrome.
For more details check this
This is what I did, go into chrome settings, go to advanced setting and hit reset, close Chrome restart PC and its gone.