I'm building an app and the client wants the following logic:
User logs in to the app.
User selects a Friend.
User selects a gift that the User will send to his Friend.
User writes a message to his Friend.
Friend receives a SECRET notification about the gift.
With "SECRET" I mean that Friend will not be able to see WHO is the User that sent the gift.
So the concrete question is how to send a notification to the FRIEND without a clue about the USER that sent it? I think is not possible but I want to be sure and check with the experts.
And if it's not possible, what do you recommend to accomplish something like this? Should I use the app request dialog and hope that the Friend will see it? Is there any other FB API tool I can use?
I really appreciate your help.
What you're trying to achieve is not possible with FB's API. As explained already by #CBroe.
You can send a request notification if the user uses your app. However, You can do one thing but that won't be completely anonymous.
You can send the friend a notification from the user and make it just an invite to try the application and after the friend uses your app (authenticates), your app can then send a notification and say someone left a SECRET message for them. This could be after few hours or instant, Whatever you/your client prefers. However as i said, this won't be completely anonymous nor it's hard to guess who left the message unless the friend isn't smart enough to know who that could be.
With the beta Notification API something similar would be possible, but only if the receiver has authenticated your app: https://developers.facebook.com/docs/games/notifications/#impl
Related
I'm trying to implement push notification but I'm a little bit lost.
I just want to have a button in php and when I click it, a notification appear in all devices telling the users something like: "A new image is available in the web".
I read the GCM documentation but I'm not sure how to start.
I see that in some examples the users have to send their emails in order to register their "sender id"? it is necessary? I want the user don't have to register anywhere.
Can someone help me to start or give me a quick tutorial?
Thank's for all.
You will need to use curl to call the GCM, you can find examples like this all over SO, for example : how to send a notification to millions of android devices in php using GCM (first one that came up in a search)
And of course you will need the registration id's otherwise GCM doesznt know which device to send the notification to.
The solution is not so simple. You should at least use some package dedicated to this specific service. Also, you should read something about what push notifications are.
There are many services out there you can use to interface yourself with this specific kind of service.
Take a look to this service to get a first idea about the entire mechanism. Remember that you have to subscribe to a push service provider for every platform you want to use. For example the Apple Push Notification Service, or Cloud Messaging by Google.
Hope it's a good start for you.
I am trying to develop an android app that verifies a transaction initiated from a browser on a PC. I want the server application to push a notification of a new transaction to the app so the user can confirm to complete the transaction. The tricky bit is the transaction is specific to a particular person (I'm using this as an alternative to sending an SMS for example). Can anyone help on how to go about this? Is it possible to do this with C2DM or GCM?
Using Android GCM is advisable. The complete reference to GCM is available at
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Step by step GCM development is given in there. It is really very helpful. Hope this is helpful to you.
The critical thing you need to keep in mind before making a decision is that when you are using GCM, you need to keep a track of the users by keeping their GCM_ID in your database. You can add a gcm_id column to your users table for this and whenever the user opens your app, the gcm_id should be updated in your database. The gcm_id of the user's phone can change, from the official docs:
Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATION intent may be called multiple times
GCM push notifications wont be able to reach your users mobile phone all the time,especially if his phone is not connected to internet or switched off.You are using this for transactions etc, so I assume that the notifications must not fail. You should keep a check in your web application to send an SMS or notify the user that this has failed. You should get a response from GCM to your server through which you can identify a failed case.
I am co-developing an app with an ios programmer. In our app there is a feature of Share Topic, in which we would like to show the list of Facebook friend (which is already done) but as per my ios programmer its not possible to get the Facebook friends list.
Any ideas? If it is not then is it possible to get it from PHP (web-services) end?
---EDIT BEGIN----
And maybe if not possible to get email addresses, then can we send private messages to those friends? Is this would be possible?
---EDIT END----
Any helpful thoughts would be appreciated. Thanks!
Your iOS Developer is wrong.
FriendLists can be accessed via the FriendList object endpoint (docs). Note that this functionality requires the read_friendlists permission.
As a side note: anything that can be acheived via the GraphAPI can be done with the iOS SDK.
Example:
[facebook requestWithGraphPath:#"me/friendlists" andDelegate:self];
I'm reviewing a lot of scripts for sending messages to Twitter accounts.
I think you just needed your account authentication (to post in the headers) to be able to send a DM to any user. Is it possible you can't do that now ?
I'm just finding examples with oAuth, but I don't need that.
What I want is to send a DM each time someone follows me, but with all oAuth examples and scripts, they use a Twitter APP, so other users "connect their accounts" to my App, but I don't want that … that is for websites and similar to "connect with Facebook" .
I need just to send DM to some users. How can I do that avoiding them to "connect to my app" ?
Thank you !
You will need to create an API key (an app, if you prefer) and then give access to this app from your own account. It will then be possible to DM people as yourself using the authentication token your app receives.
The recipients of the DMs do not need to interact with your app at all.
if you simply want to DM them on being followed check out ITTT.com 's features.
it will automate this process for you.
and it's free
I've logged in and used the Facebook CHAT api all right. The problem is that I want to have a system where anyone can send me a message, without actually being on the friend list.
When the sender is in the friend list, I see the message. Is there a possibility that I can configure my account to receive messages from anyone, independing on if they are in the friend list or not?
Best Regards.
The Chat API and the Message API are not the same.
You may want to think of Chat as a subset of messages.
When a message is received and the user is a friend you receive a chat notification, if not, no response.