Titanium London - Going Social - June 2011

1,748 views
1,688 views

Published on

Talk for London Titanium meetup, on how to integrate a tried and tested oAuth script library into a Titanium Mobile project that works on both Android and iOS platforms.

Published in: Technology, Travel
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,748
On SlideShare
0
From Embeds
0
Number of Embeds
116
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Titanium London - Going Social - June 2011

  1. 1. Going Social Connecting Your App to Twitter & More#TiLon London Titanium Meetup - June 2011 @ketan
  2. 2. Background London Titanium Meetup - June 2011 @ketan
  3. 3. Backgroundhttp://www.stereoartist.com/blog London Titanium Meetup - June 2011 @ketan
  4. 4. IntegratingTwitter into Titanium London Titanium Meetup - June 2011 @ketan
  5. 5. London Titanium Meetup - June 2011 @ketan
  6. 6. London Titanium Meetup - June 2011 @ketan
  7. 7. useuse oAuth… xAuth…Connecting your app use what?erm...? ??! London Titanium Meetup - June 2011 @ketan
  8. 8. Getting SetupTwitter ApplicationGithub Source LibrariesTitanium Project setup London Titanium Meetup - June 2011 @ketan
  9. 9. Twitter Application
  10. 10. Twitter Application
  11. 11. Twitter Application
  12. 12. Twitter Application
  13. 13. Twitter Application
  14. 14. Twitter Application
  15. 15. Twitter Application
  16. 16. Twitter Application
  17. 17. Twitter Application
  18. 18. Twitter Application
  19. 19. Github
  20. 20. Github
  21. 21. Github
  22. 22. Github
  23. 23. Github
  24. 24. Github
  25. 25. File Structure android Github Package iphone Resources oauth.js app.js oauth_adapter.js lib sha1.js twitter_api.js London Titanium Meetup - June 2011 @ketan
  26. 26. Ti.include(lib/sha1.js);Ti.include(lib/oauth.js); code in yourTi.include(lib/oauth_adapter.js);Ti.include(lib/twitter_api.js); app.js// First check for authenticationvar tState = oa.oAuthAdapter.isAuthorized();if (tState != false) { oa.oAuthAdapter.send({ url:http://api.twitter.com/1/account/verify_credentials.json, parameters:[ ], method:GET, onSuccess:function(response){ response = JSON.parse(response); // Do something with the response data alert(response); }, onError:function(response){ response = JSON.parse(response); // Do something with the response data alert(response); } }); GET} London Titanium Meetup - June 2011 @ketan
  27. 27. // First check for authentication code in yourvar tState = oa.oAuthAdapter.isAuthorized(); app.jsif (tState != false) { oa.oAuthAdapter.send({ url:https://api.twitter.com/1/statuses/update.json, parameters:[ [display_coordinates,true], [lat,latitude], [long,longitude], [include_entities,1], [status, someText] ], method:POST, onSuccess:function(response){ response = JSON.parse(response); // Do something with the response data alert(response); } }); POST} London Titanium Meetup - June 2011 @ketan
  28. 28. Known Issues Android Browser Password Dialog iOS & Android xAuth Messy Codebase Using other Social Networks London Titanium Meetup - June 2011 @ketan
  29. 29. AlternativesCustom URLsBuilt in porotocol handlers registered by AppsSurrey Police AppSCI-FI-LONDON London Titanium Meetup - June 2011 @ketan
  30. 30. London Titanium Meetup - June 2011 @ketan
  31. 31. London Titanium Meetup - June 2011 @ketan
  32. 32. London Titanium Meetup - June 2011 @ketan
  33. 33. LinksLearn about oAuthTwitter and oAuthGithub accountoAuth libraryoAuthTest appMeetup.com London Titanium Meetup - June 2011 @ketan
  34. 34. Thank Youhttp://www.stereoartist.com/blog/london-titanium-june-2011http://goo.gl/qbijE London Titanium Meetup - June 2011 @ketan

×