Sending Notifications Using User's SessionKey

Oct 29, 2007 at 6:56 PM
I'd like for my application to be able to send more than the limit of 20 notifications per day. A common approach discussed on the Facebook developer site is to create a new session using the recipient's sessionkey, and then send the notification.
But from what I see in the Facebook.Net code, you can't do that--it's designed to only use one session.
Do you think it would be possible to overwrite the SendNotification method to add a SessionKey parameter and, in that method, encapsulate whatever code is needed to create this session and send the notification?
Otherwise, it looks like I'm stuck and my Reminder application will be limited to sending emails from my web server.
Dave
Developer
Oct 29, 2007 at 7:38 PM
Just to clarify, I take it this is some sort of application which allows users to set reminders for themselves, and then have those reminders sent to them later on, at whatever time they specified. Is that mostly correct?

If so, I assume your problem is that you're sending all your notifications from one account instead of from each user's account. Okay, I think I basically see what you're trying to do. So, how are you planning on getting a session key for the recipient? Are you using infinite sessions for all of your users? If I'm understanding this all correctly, I think my advice would be to create a new FacebookAPI object for each user each time you want to send notifications, set the SessionKey, ApplicationKey, Secret, and UserId properties on that object, and use it to send out your notifications. I'd rather not add a SessionKey param to SendNotification, since I think that breaks an abstraction barrier there, and would just make things more complex for the user.

Does that all make sense?
Oct 29, 2007 at 8:23 PM
Yeah, you understand it. Users would set up reminders, and periodically an admin would send everything that's scheduled.
Capturing and storing the user's session key is no problem.
So I'll try what you say: creating new FacebookAPI objects for each user and use that to send their notifications.
Thanks!
Dave


jschuster wrote:
Just to clarify, I take it this is some sort of application which allows users to set reminders for themselves, and then have those reminders sent to them later on, at whatever time they specified. Is that mostly correct?

If so, I assume your problem is that you're sending all your notifications from one account instead of from each user's account. Okay, I think I basically see what you're trying to do. So, how are you planning on getting a session key for the recipient? Are you using infinite sessions for all of your users? If I'm understanding this all correctly, I think my advice would be to create a new FacebookAPI object for each user each time you want to send notifications, set the SessionKey, ApplicationKey, Secret, and UserId properties on that object, and use it to send out your notifications. I'd rather not add a SessionKey param to SendNotification, since I think that breaks an abstraction barrier there, and would just make things more complex for the user.

Does that all make sense?