Talk:Notifications.send

From Facebook Developer Wiki

Jump to: navigation, search

Contents

[edit] In Facebook Connect for iPhone, the UID is a long long. Don't format it as an int, or a long. It won't work.

[edit] Error codes missing

At least the following error code is missing from the table: Invalid user id list (114). Can someone update the table with all possible error codes? 517349549 11:13, 26 July 2009 (PDT)

[edit] Trying to send an App add message when the user logs in

I have an application for which I am creating a Facebook app. I want to know that if during the registration of my app the uer provides me with their Facebook credentials, can I do something to send them a message to add the app when they log in the next time?

If I understand what you're asking, when a user authorizes your application, you can't then send a notification to prompt them to add your application. The concept of "adding" an application was streamlined when we launched the new profile over the summer, so the user no longer sees the add.php page. You can prompt them to bookmark your application. Put a reminder on your canvas page, for example. --Pete 563683308 07:37, 7 November 2008 (PST)

I can't seem to get a return code for this using the php library.. it's always blank so I can't check if the user has reached the send notification limit for the day.

[edit] Clarification Required: Notifications.send - Notifications vs. Requests

Notifications.send talks about two types of communications: Notifications and requests.

Unfortunately, it doesn't say how to send one type or the other. Is the documentation out of date, or is there a parameter that can be passed to choose which type of communication?

What I think I'm reading is that if you set the "type" parameter to "user_to_user" communication, it's a "request", whereas if you set "type" to "app_to_user" it's a "notification". If this is the case, please state this explicitly in the "type" parameter description to make it clearer.

 e.g 
 "Set 'type' to 'app_to_user' to send a notification, or 'user_to_user' to send a request."

Thank you.

That's not how it works. Both app_to_user and user_to_user are notifications. The docs say "Sends a notification or request to a set of users." There should be some info about how to actually accomplish this.

This was an error here. Use fb:request-form to send a request. The user needs to see and approve the request before it can be sent out, so it can't be an API call. Sorry for the confusion. -- Pete (563683308 13:51, 26 November 2008 (PST))

[edit] Mistake in the top paragraph

It says two times "User-to-user notifications", one of them should be changed to "Application-to-user notifications".

User-to-user notifications can be sent to application users who aren't friends of the application user generating the notification. User-to-user notifications can be sent from an application user to the friends of the user, whether or not they use the application.

Please change it!

No, the article is correct as written. U2U notifications can be sent to:
  • other users of the app who aren't friends of the originating user, and
  • friends of the user who may or may not be app users.
-- Pete (563683308 14:14, 5 January 2009 (PST))

WHAT ABOUT "app_to_user" ? Using user A I tried to have my application initiate a notification to user B with "app_to_user" It worked ONLY when A and B are friends. However, when not friends it does NOT work AND does not show any error code either - only an empty string is returned by the notification_send function with app_to_user on A to B - although on error, it should present an error code.

Is the "app_to_user" option supposed to permit send from the application to ANY app_user? if yes, how do I initiate the send? Am I doing something wrong by having the send go out from a user's active session - it is afterall the USER that initiates the send - but I prefer using "app_to_user" as it does not prepend the notification with a user name.

How can IO have the "app' send a request anyway if not in the scope of a user - just set the sessionkey to null? What do I do for that option? KEN 518096041

App to user notifications are for when you want to communicate something from your app to a given user or users (like "It's Hump Day. Play this game!"). Don't use them for communication *between* users (like, user A telling user B to take a turn in a game) -- that's a user to user notification. Don't include a session key. Does this help? Pete (563683308 18:17, 23 September 2009 (PDT))

[edit] Clarification on Mention of Insights page.

The insights page is accessed by clicking on the link named statistics in the apps developers page.

Hi everybody (sorry for my bad english).

i'm using the client facebook php and $facebook->api_client->notifications_send('123456789','my text'); in my project but it doesnt't seem to work.

i unfortunaly always have the same text in front of my page when i use it : "error while loading myproject ...".

i tried a lot of things but nothing changes. i'm very disapointed.

do you think there is an incompability with my php server (version>5.2) ? i know that they block some fonctions from php for some security reasons.

[edit] I need to know for limits of Notification.send

Hi, I need to know for limits for Notification.send function! for example if have destiny users limit or similar!

My problem is that when I try to send too much notification at same time, some users (or everyone, i'm not sure) don't get the notification!

Pleace, somebody have any information of that? I will be very grateful! Thanks

-- I second that. Daniel (1627546283 8:43, 30 July 2009 (GMT))

It is not clear how many users can be targeted in a single call.

The issue you'll face is that the more UIDs you include in the call, the greater the chance of the call timing out. I'll add a suggestion that you shouldn't include more than 50 UIDs in a call, but YMMV. Pete (563683308 14:33, 30 July 2009 (PDT))

[edit] Images not showing

How do I get images to appear inside notification messages? I have tried every variation of an <img> tag, with double quotes and single quotes, with spaces before the closing marker (/>) and without. Nothing seems to work. Any suggestions?

You can't use images inside notifications.

[edit] notification amount incorrect.

I made a facebook app and one of the things its supposed to do is send notifications to the users' friends. I read that I should limit the amount of notifications I send at one time to 50. I have done that but when I ran my app I only saw that 5 notifications had been sent. I tried running it several times but no more notifications seemed to go out. here is my PHP code:

$friends = $facebook->api_client->friends_get();

$friends = array_slice($friends, 0, 50);

$note = "this is my notification";

$facebook->api_client->notifications_send($friends,$note,"user_to_user");

Please file a bug and include this code and your app ID. Thanks, Pete (563683308 13:23, 8 September 2009 (PDT))
reference