-
-
Notifications
You must be signed in to change notification settings - Fork 191
notifications
Niklas edited this page Oct 29, 2013
·
6 revisions
me = FbGraph::User.me(ACCESS_TOKEN)
me.notifications
notification = FbGraph::Notification.new(NOTIFICATION_ID)
notification.read!(:access_token => ACCESS_TOKEN)
There are 2 ways to send notifications to a user.
I feel FbGraph::Application#notify!
more natural, but it’s actually just calling FbGraph::User#notification!
internally.
user = FbGraph::User.new('matake')
app = FbGraph::Application.new(APP_ID, :secret => APP_SECRET)
app.notify!(
user,
:href => 'http://matake.jp',
:template => 'Your friend @[12345] achieved new badge!'
)
user.notification!(
:access_token => APP_ACCESS_TOKEN,
:href => 'http://matake.jp',
:template => 'Your friend @[12345] achieved new badge!'
)