Friday, July 29, 2011

Facebook Graph API Development with Flash






Table of Contents
Preface 1
Chapter 1: Introduction 7
What's so great about Facebook? 7
It's popular 8
Numbers 9
It's everywhere 9
It's interesting to develop for 11
Web hosts 11
What's a web host? 11
Why do you need one? 12
How do you choose one? 12
Useful software 13
What about domain names? 13
How much AS3 knowledge is required? 14
The source code 15
Powered by… 17
Debugging 18
Watch out for caching 19
A final note… 21
Chapter 2: Welcome to the Graph 23
Accessing the Graph API through a Browser 24
Time for action – loading a Page 24
Accessing the Graph API through AS3 27
Time for action – retrieving a Page's information in AS3 27
Time for action – deserializing a JSON object 32
Time for action – visualizing the info 33
Understanding connections 36
Time for action – finding connections in a browser 36
Rendering Lists 40
Time for action – rendering Lists of Posts 40
Rendering connections 45
Time for action – displaying a Graph Object's connections 46
Introducing the Requestor 48
Time for action – creating an HTTP Requestor 48
Understanding Connections of Connections 55
Time for action – loading photos from an album 56
Putting it all together 61
Time for action – traversing the Graph 61
Summary 64
Chapter 3: Let Me In! 65
What can you see? 65
Time for action – snooping through other people's accounts 65
What's that got to do with the Graph API? 69
Access tokens are proof of authorization 70
User/Application authorization 70
Time for action – registering an application with Facebook 72
Application ID + logged-in user = access token 74
Time for action – requesting an access token with the browser 75
Registering a redirect URI with our application 75
Using the Access Token 78
Me, me, me 80
Keeping secrets 81
What did Facebook give us? 81
Authenticating with AS3 83
Time for action – Using an access token in our Graph visualizer 83
That's cheating! 88
Time for action – authenticating through the application 88
A different approach 91
Time for action – authenticating via JavaScript 91
Creating a callback web page 93
Receiving the access token 95
What about users who haven't used the application before? 99
Extended permissions 101
Time for action – obtaining extended permissions 101
Time for action – requesting extended permissions 102
I want it all, and I want it now 106
Using the Adobe ActionScript 3 SDK for Facebook platform 106
Time for action –implementing the SDK 107
Summary 115
Chapter 4: Digging Deeper into the Graph 117
Getting more results with paging 117
Time for action – displaying the number of objects in a list 118
Time for action – requesting more Objects 122
Time for action – requesting more Objects at once 124
Paging 125
Time for action – obtaining data in pages 126
Time for action – adding limit and offset to GraphRequest instances 128
Time for action – requesting data based on date 131
Time for action – adding since and until to GraphRequest instances 133
Time for action – filtering by date using the UI 135
We gon' partition like it's yo' birthday 139
Time for action – using the ids parameter in a Graph URL 141
Summary 144
Chapter 5: Search Me 147
Using the website's Search box 147
Time for action – examining quick search results 148
Time for action – Using the Full Search results 150
Searching with a Graph URL 153
Time for action – searching without authorization 153
Time for action – searching while authorized 158
Differences 161
Restrictions 161
Time for action – implementing a Search window in the 163
Visualizer 163
Time for action – searching via the SDK 167
Time for action – searching your news feed 171
Time for action – searching a friend's Wall Posts 172
Time for action – searching feeds through the Visualizer 175
Summary 181
Chapter 6: Adding to the Graph 185
Hello, Facebook! 185
Time for action – posting to the user's feed 185
Request methods 189
What's a request method? 189
Time for action – using the POST method 190
Time for action – listening for errors 193
Time for action – granting the required permission 195
Time for action – posting via the SDK 197
Going further with Wall Posts 199
Time for action – publishing rich posts 200
Posting to another Wall 206
Time for action – posting to another Wall using the Visualizer 207
Actions, privacy, and source 208
Actions 208
Time for action – literally 209
Privacy 211
Time for action – setting a Post's privacy settings 211
Source 214
Deleting Graph Objects 214
Time for action – deleting a Post 214
Time for action – deleting Posts using the Visualizer 215
Publishing other kinds of Graph Object 221
Comments 222
Likes 222
Deleting Likes 223
Notes 224
Events 225
Event RSVPs 226
Albums 227
Photos 228
Checkins 230
What about...? 230
Sending inbox messages 230
Creating Pages, Groups, Applications, and Videos 231
Changing biographical information 231
Making Friends 231
Inviting Friends to Events 231
Summary 232
Chapter 7: FQL Matters 235
What is FQL? 235
Understanding the FQL interface 236
Models of data 237
Representations of data 238
Getting information 238
Time for action – retrieving info from the Page table 239
What about connections? 243
Photos, Albums, and their Owners 245
Primary keys 247
Crow's feet 248
Link tables 249
Time for action – getting a user's friends' names with AS3 251
Time for action – an easier way 252
Time for action – getting it down to one API call 253
The Graph as a layer 254
Permissions 255
Checking existing permissions 255
Getting more information 256
Restrictions 256
Searches must use an indexable field 257
Does this matter in practice? 258
Advanced FQL 258
Operators 258
Comparison 258
Logical 258
Ordering 259
Paging 260
Extra functions 261
Calling multiple queries at once 262
Summary 263
Chapter 8: Finishing Off 265
Putting it online 265
On Facebook 266
IFrame 266
Time for action – setting up an IFrame application 267
Page tab 270
Time for action – adding an application to a Page tab 271
Off Facebook 274
Your own website 274
Flash game portals 274
As a desktop AIR application 275
Time for action – authorizing through AIR with HTTP 276
Time for action – authorizing through AIR with the SDK 278
As an AIR for Android Application 280
Time for action – authorizing on Android 280
Choosing your application's Facebook settings 283
Getting your application out there 284
Editing the application's profile page 284
The Facebook Application Directory 288
Watch out for these policies! 289
What next? 289
The Official AS3 Facebook SDK 289
Other Facebook APIs 290
JavaScript SDK 290
Insights API 290
Facebook Chat API 291
Internationalization API 291
Adobe Social service 291
Related Technologies 291
PHP 291
Open Graph Protocol 292
Real-Time Updates 292
Brand new and coming soon 292
Facebook Credits 292
Test users 293
The New Messages 293
Facebook developer resources 293
Official Facebook resources 293
Other great websites 294
Me, me, me 295
Keeping up with the Zuckerbergs 295
Dealing with change 296
Summary 296
Pop Quiz Answers 297
Chapter 2 297
Chapter 3 297
Chapter 4 297
Chapter 5 298
Chapter 6 298
Chapter 7 298
Index 299

Another Social Network Books
Download Book
Download Code

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!