Building my first telegram bot and it's going to be quite complex.
Part of workflow needs to open a webview within telegram that will require user interaction, return to bot chat altering chat with data received from user.
Reading through the entire api, SO, github, I'm having trouble finding anything about the viewing webpages, much less if we can interact. Before I get deep into this project it would be awesome to have some starting direction.
Can you create web views (like you see for "instant view" articles, google maps, etc), and if so can you get data from user to use back at the chat bot?
Another option is possibly using a "game". In our case, it won't be a conventional game, but maybe we could use the html5 game to render what we need, and interact with the user. I know it can pull scores, names, etc to update message, maybe we could somehow make this work?
I'm currently working through the api. This is one of my first apps, and my first telegram bot. I really appreciate any assistance on how to get started here.
This is in Rails, using https://github.com/telegram-bot-rb/telegram_bot_app as a starter. Mostly needing to know if this concept it possible, but anything more specific would be great, too. Thanks!
You can't create web view with the bot API and you don't need to do that. You can simply link to a web page using simple links or inline buttons and the page will open in Telegram's inline browser (Depending on user's settings).
If you include the user ID in the URL you will know who is using the webpage. e.g example.com?uid=1234
Now that you know who is using the webpage, you can use the ID to send messages or anything else in Telegram chat while user is on the webpage.
At the end you can redirect the user back to your bot URL (telegram.me/botusername).
Update
You can now use Seamless Telegram Login to link to a web page and log in the user. This feature can also be used in groups
Try the new Telegram Web App API
It can open a web page on the bottom sheet, which you can expand almost to the full screen.
You can configure the web app open button by following these steps:
Open BotFather
Type /mybots, select your bot
Click Bot Settings > Menu Button
Set up a menu button that opens a certain URL
Related
I implemented universal link to my iOS app. It directs user to application if url has this "www.websiteurl.com/suburl/*.com" pattern.
I want this work only if user click this url from google search result. If user is already in website I want to open url in website either not open the application. How can I prevent it?
edit: I implemented Support Universal Links documentation.
Yes, this is possible, but I don't recommend it. If the user has the app installed, it seems like you should want to open the app as soon as possible since it is a much better experience. Anyways, here's my solution.
Option 1
Short answer: Wrap your website links in javascript
Why? according to the Apple standards of Universal Links, a link must be clicked on by a user to trigger the Universal Link, therefore if you set up all of your links on your website to be handled by javascript, the app will never open from inside your website.
Therefore, change
Link
Into a javascript call
Link
And open the link from javascript
function clickLink(link) {
window.open(link);
}
Option 2 (Better option)
Use a third-party like Branch links for all of your deep linking so that you can pass more context from web to app allowing the user to continue the same experience on mobile that they were just having on the web. Native is a much better experience 99.9% of the time and it converts users at a much higher rate than web.
Looking to integrate the branch.io in such a way that the admin gets the deep link at web end where he adds the content. And then he manually post the link to some social media say Twitter,Facebook etc. then user clicks on that link and it will take the user to app or app store.
Is it possible, please guide how to handle this. I am quite confused about branch.io. As far i understood branch.io creates the link send via sms and user clicks and gets redirected to app or app store. Is my requirement valid? How to achieve this please guide. Already spent more than a half day on it.
(Full disclosure: I am on the Branch.io team)
This is actually a very common Branch use case, so it's fairly straight forward to implement.
1. Sign up for Branch
Easy step!
2. Integrate the SDK into your app
This is a fairly simple process that should take less than half an hour, and the latest step-by-step docs for doing this are always at the link above. I won't include the full instructions in this answer because Apple creates new roadblocks fairly regularly, and we often have to make small tweaks to the guide.
After you complete this step, any time a user opens a Branch link associated with your app, either your app will launch (if installed) or that user will be sent to the App Store page to download it.
3. Create your marketing link
The link above takes you to the Branch dashboard. From that page, you can create a new Marketing Link, and use the Deep Link Data section to specify a key/value pair. For example, you can set a key of content and assign it the value mycustomvalue:
When your app launches after a user opens this link, the content : mycustomvalue pair will be magically returned to you.
4. Configure Deep Link Routing and Universal Links.
These methods are what actually call back to the Branch API every time your app opens, returning the content : mycustomvalue pair that you encoded in the link. You can do whatever you like with these values, but here are two common approaches:
Route the user to the content that you specify corresponds to mycustomvalue.
Use the values directly to display something customized (for example, if you encoded content : You've been sent a special invitation!
5. Share the link wherever you like!
The link you created can be put anywhere. Email, Twitter, Facebook, paid Google Ads, etc.
I wanted to confirm if this is possible. I want to publish "User To User Requests" directly to the open graph action with my own UI (specifically the friend selector).
My friend selector does follow the platform guidelines (ie do not allow users to select all users at once). My question is that can I publish these requests directly without having to use any of the FB UIs including the request dialog preview (we are going to show our own preview).
This is to be built on iOS. The primary reason we want to use our own UI is because our design team feel that the popups hinder UX on mobile and they want to make it seamless. Their reasoning is a design issue that probably up for another discussion all together, but what I want to know is about using the requests api without using the native FB ui.
The answer is simply, YES, yes you can do this and then post the request to each friend using the id's of the friends selected by the User. All you have to do is just retrieve the friend list retrieve selected user ids and POST to them the requests.
How do I trigger a programmatic post to a specific person's Facebook wall so that it looks like this (but replace GO TRY IT ON with my app):
I do not want this to be a generic post to the world. I want this targeted to the specific user's wall whom I specify. I want to include a specific message. I already have social discovery for my app enabled (meaning that I can see my app when I search facebook on my iPhone, and I see it in my list of apps such that I can tap the row and launch my app from facebook).
Looks like you want to familiarize yourself with the concept of the Open Graph -> https://developers.facebook.com/docs/opengraph/
product is obviously an object defined in that apps open graph settings, and suggesting is an action that can be undertaken with products.
So what you've shown us in this picture is not a normal post, it's the publication message of an Open Graph action.
But I'm not aware of any simple way to make this publication visible only to one user. The general visibility is set by the user in the auth dialog for your app. I don't know if there's a way to further restrict visibility for a single action publication, maybe by dynamically creating a friendlist with only that one user in it or something …
I'm trying to figure out the best way I can inform analytics trackers that the page view is coming from my app, rather than a 'direct visit' (for example).
I have an app that displays a list view of tons of different news stories, and I want to make it so that, when a user taps on one of the stories, and it is displayed in my UIWebView, the website being loaded is somehow informed that the referral came from 'example-iphone-app', or maybe my iPhone app's website?
Is there any way to manipulate the http request to make the iPhone app act as if the link is being opened by a referral link on my website?
I was originally thinking of just adding a query string with a parameter like ?source=myappname, but realized this is not a reliable (or even useful) way of alerting site owners with Google Analytics, SiteMeter, Urchin, etc. from where the request has come.
If you're using Google Analytics then you can set the utm_source and utm_medium query parameters and they will be displayed as the referral source. utm_source is where you would put your myappname parameter and utm_medium should probably be set to referral unless you are charging per click then it is usually set to cpc.