Guys i'm creating a bot on a telegram that at certain (textual) input responds by writing in various ways.
The bot is also able to create buttons in the telegram chat (between the user and the bot).
In one of these buttons, if the user clicks, a page from my website opens.
I have to switch the chat ID to this internet page but I'm looking for a safe way to do it.
I could put the id in the link
example.com?chat_id=xxx
but it's unsafe and I don't want the user to be able to change the link and the value of the chat_id
So how could I do?
Is there a way to pass the data to the internet page from file.php?
In short, a POST method
I hope you can help me (sorry for my English)
When you get "chat_id", you can get user id too.
users.getUsers
Returns basic user info according to their identifiers.
You need to create a key, for your bot. Use the same in your php
application. Make a hash with infos and your key.
Replace example.com?chat_id=xxx with
example.com?chat_id=YOUR HASH.When the user go to your page, decrypt them with your key.
And now, you have chat id & user.
I recommend to use a salt
Related
I want that user can post on my android app (on a discussion) without registration. But I also want to make an identification of the post, who posts the post. I thought I will save user's phone's IMEI no to identify him. So that I can show his post to him (on my posts section).
Is it safe to use IMEI? Or is there any way to do my work successfully.
I want to add that I will save the post to my web server.
On Android you can save data in the "sharedpreferences" and retrieve the saved key later to display posts made by the user. However, if the user clears your application data, the key is lost.
An other option, you can use Android MySql, save both userId and postId or just postId. When the user launches the app, get posts from your server.
Hope this help.
im not that much in android app development, but it is possible to change the IMEI number of android phones easily.
Also, if 2 users want to use the application on the same smartphone, there will be an issue.
if you don't set up registration with at least email, im not sure you can log which user posted what.
I read the Facebook dev info on how to make a request (located here) but I don't exactly understand what it does. Here's what I'd like to do. I'm using PHP and javascript.
I want a logged in user to send a request to a specific URL (with parameters attached) to multiple Facebook users (users who are already signed up for my site). Also, I need to be able to get the users that they selected and save them in the database, because only those users will have access to the URL that they're being invited to.
Are there any suggestions on how I can accomplish this?
I'm thinking you are talking about the a url request. From my experience this can be done using a simple JQuery request. You can find an example here and you can also read up on java APIs and how to use the methods(Google it). Hope this helps.
The requests dialog is for invitations to Facebook Canvas applications.
You are most likely thinking about the send dialog: https://developers.facebook.com/docs/reference/dialogs/send/
Add a callback function to FB.ui call that saves the id, this will only work if the user ids are hardcoded in. If the user manually adds them, I doubt you can track it.
I would like to embed the facebook request form on the fan page without asking for permission, is it possible that the friend selector does not popup but instead displayed on the fan page?
The problem I am facing is
As I do not want to bother user for permissions I do not have the Current UserId, which I need for computation of who send how many request
Do not want the app request to popup
Do not want to use the fbml as it will get deprecated by June 2012
Any help how can I do this using PHP?
As you say yourself, you need the current user id. I'm sure you can get this without permissions along with other basic data such as name and gender etc.
try:
https://developers.facebook.com/tools/explorer/?method=GET&path=YOURUSERIDand you'll see.
As for showing the multi-friend selector in the page rather than as a popup, I've not done it myself but usually you can specify the display parameter, e.g. &display=page (rather than display=popup
Also, I think you have to use the JS SDK to do this and not PHP:
http://developers.facebook.com/docs/reference/dialogs/requests/
Also, if you want to send notifications to your user's friends then you will require permissions to do so.
How to get like status of google+ button on website or url? I am using PHP.
Unfortunately this isn't quite possible. Neither the REST API nor the PlusOne button itselfs provides a method to check whether a user has +1'd the page or not. Furthermore, if you're using PHP, the user would have to authenticate himself first (using OAuth), so that's probably not what you want, anyway.
What you can do, however, is using Javascript to catch actions of the current visitor. You can specify a callback parameter when creating the +1 button which will be called everytime when the user clicks on the +1 button (source).
While this approach doesn't provide you any information about who the user is (in terms of Google+ user), you could track his actions on your server using a cookie or something else. Or, if that's sufficient, just use the information for the duration of his stay.
if you are trying to get the statistics of your website's +1s, google's webmaster tools will provide the data.
YOu can get this from +1 metric menu in left panel in webmaster tools
Hello I am looking for a best way to ask/forward user so he/she adds my app to their page
one way is to make them follow the link
http://www.facebook.com/add.php?api_key=[your
application api key]&pages
(http://www.facebook.com/add.php?api_key=1fc2946c634702dfc75cce79c97c8cec&pages -real life example)
wrapping up the question: as facebook has made a lot of changes maybe the above method is the outdated one(though it is supported), and is there are any more ways to get same result?
This is still the best/official method. So long as the API key is valid and you pass the pages flag (blank value) it will prompt a user to add it to their pages, and will give them an option to select which page to post to (if they have more than one page with admin access)