Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Titanium ならここまでできる !! Serverside non-programing...

Titanium ならここまでできる !! Serverside non-programing で作る お手軽 Social Application

「サンプルアプリでデモ」の部分の内容はありません。

astronaughts

August 13, 2012
Tweet

More Decks by astronaughts

Other Decks in Technology

Transcript

  1. Profile ͏͑ͷ·͞ͻΖ ࢓ࣄͰ͸ओʹ WebService ͷ։ൃʢPython / Djangoʣ Titanium ͸ࠓͷͱ͜Ζझຯɺࣾ಺ Project

    Ͱ΋࢖͍͍ͨ Titanium ྺ 1 ೥൒ऑ Titanium ͰϦϦʔεͨ͠ΞϓϦ 0 Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  2. Agenda - ACS Ͱ Sreverside non-programming Ͱ։ൃ - SingOn ͷ۩ମతͳ։ൃखॱ

    - ACS ࢖ͬͯͯݱ࣌఺ͷϝϦοτʗσϝϦοτ - ͓·͚ Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  3. Agenda - ACS Ͱ Sreverside non-programming Ͱ։ൃ - αϯϓϧΞϓϦͰσϞ -

    ACS ࢖ͬͯͯݱ࣌఺ͷϝϦοτʗσϝϦοτ Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  4. ACS ͱ͸ʁ Appcelerator ͕ఏڙ͢Δ Titanium ͷͨΊͷ BaaS Titanium SDK 2.0

    ͔Βొ৔ API ͕ॆ࣮͍ͯͯ͠ Titanium Ҏ֎͔Β΋ར༻Մೳ Web ্Ͱσʔλͷ؅ཧ͕ग़དྷΔ ͔͠΋ҰఆྔͷΞΫηεͳΒແྉɻஅવ͓ಘʂ Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  5. BaaS ͱ͸ʁ ຊདྷɺϞόΠϧΞϓϦ։ൃʹඞཁͩͬͨόοΫΤϯυ෦෼Λ ఏڙͯ͘͠ΕΔ৽͍͠αʔϏε - Ϣʔβʔ؅ཧ - σʔλετΞ - ֤छιʔγϟϧαʔϏεͱͷ࿈ܞ

    - ϩέʔγϣϯ࿈ܞ ఏڙ͞ΕΔओͳػೳ ͭ·ΓίϨΛར༻͢Ε͹αʔόʔαΠυͷ։ൃ͸ෆཁʂʁ Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  6. API ͷछྨ Ti.Developers.meeting vol.5 in Kyoto ACS Ͱग़དྷΔ͜ͱ - Ϣʔβʔ

    - ࣸਅσʔλ - Push σʔλ - ϝʔϧςϯϓϨʔτ - ΧελϜΦϒδΣΫτʢJSONʣ - Key - Value Tier 1 APIs - Ґஔ৘ใ - Statusɹ - Postɹ - ... ͦͷଞ͍Ζ͍Ζ Tier 2 APIs ଟ͍ͷͰলུɺTier 1 APIs Ͱ͍͍ͩͨ OK ͪΌ͏ʁ 2012೥8݄13೔݄༵೔
  7. ؾʹͳΔແྉ࿮ Ti.Developers.meeting vol.5 in Kyoto ACS Ͱग़དྷΔ͜ͱ ͍ͮΕ͔Λ௒͑Δͱ STOP ...

    ʢʈpʈʣ 250,000 Tier 1 APIs calls 250,000 Tier 2 APIs calls 5 GB strage Quotas are per month 2012೥8݄13೔݄༵೔
  8. ௒͑ͦ͏ͳ৔߹͸ɺ௥ՃͰ࿮ΛߪೖͰ͖Δ Ti.Developers.meeting vol.5 in Kyoto ACS Ͱग़དྷΔ͜ͱ ίϨͳΒ͓খݣ͍ͰͳΜͱ͔ͳΔʂʘʢʈ0ʈʣʗ + 1,000,000

    Tier 1 APIs calls / $10 + 500,000 Tier 2 APIs calls / $10 + 20 GB strage / $5 Quotas are per month 2012೥8݄13೔݄༵೔
  9. ACS Λ࢖ͬͯΈΔ Ti.Developers.meeting vol.5 in Kyoto Titanium Studio ͔Β৽ن Project

    ࡞੒࣌ ͜ͷը໘Ͱ༗ޮʗແޮΛઃఆͰ͖Δ ͜Ε͚ͩ ޙ͸ී௨ʹ։ൃ 2012೥8݄13೔݄༵೔
  10. ιʔεϨϕϧͷղઆ Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ Cloud = require('ti.cloud');

    // ϞδϡʔϧΛಡΈࠐΉ ϞδϡʔϧͷಡΈࠐΈ ࣮͸ ACS ༗ޮԽͨ࣌͠఺Ͱɺ tiapp.xml ʹ ti.cloud ͕ࣗಈతʹಡΈࠐ·Ε͍ͯΔ 2012೥8݄13೔݄༵೔
  11. ιʔεϨϕϧͷղઆ Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ Cloud.Users.login(function(res){ ɹɹ... });ɹ

    Cloud.Users.logout(function(res){ ɹɹ... });ɹ API ͷར༻ ... ϩάΠϯʗϩάΞ΢τ ACS ͷ֤ API ΁ΞΫηε͢Δʹ͸·ͣϩάΠϯ͢Δඞཁ͕͋Δ ※ Ұ෦ೝূͳͯ͘΋ΞΫηεՄೳͳ΋ͷ΋͋Δ 2012೥8݄13೔݄༵೔
  12. ιʔεϨϕϧͷղઆ Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ var params =

    {ɹ ɹɹclassname: ‘favorite_players’, ɹɹwhere: { user_id: ‘4ff3e0e10020441805003a61’ }, };ɹ Cloud.Objects.query(params, function(res){ɹ ɹɹif (res.success) ɹɹɹɹTi.API.info(res.favorite_players); }); API ͷར༻ ... ΧελϜΦϒδΣΫτͷऔಘ 2012೥8݄13೔݄༵೔
  13. Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ { success: 1, error:

    0, meta: { code: 200, method_name: 'queryCustomObjects', page: 2, per_page: 10, status: 'ok', total_pages: 2, total_results: 12, }, favorite_players: [ { id: '4feaf1e70020447dd304cfd0', name: 'Randy W Bass', number: 44, created_at: '2012-06-27T11:43:35+0000', updated_at: '2012-06-27T11:43:35+0000', user: { ... }, }, API ͷར༻ ... ΧελϜΦϒδΣΫτͷऔಘ݁Ռ 2012೥8݄13೔݄༵೔
  14. ιʔεϨϕϧͷղઆ Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ Cloud.Objects.query Ͱ where

    Ҏ֎ʹࢦఆͰ͖Δ৚݅ - ݁Ռͷιʔτ ... order order: ‘created_at’ // ࡞੒೔ॱ - ϖʔδ ... page page: 2 // 2 ϖʔδ໨Λऔಘ - 1 ϖʔδ͋ͨΓͷऔಘ݅਺ ... per_page per_page: 15 // 1 ϖʔδ͋ͨΓσʔλΛ 15 ݅ͣͭऔಘ 2012೥8݄13೔݄༵೔
  15. ιʔεϨϕϧͷղઆ Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ var params =

    {ɹ ɹɹclassname: ‘favorite_players’, ɹɹfields: { name: ‘Randy W Bass’, number: 44 }, };ɹ Cloud.Objects.create(params, function(res){ɹ ɹɹif (res.success) ɹɹɹɹTi.API.info(res.favorite_players); }); API ͷར༻ ... ΧελϜΦϒδΣΫτͷ৽نొ࿥ 2012೥8݄13೔݄༵೔
  16. ιʔεϨϕϧͷղઆ Ti.Developers.meeting vol.5 in Kyoto ACS Λ࢖ͬͯΈΔ API ͷར༻ ...

    ΧελϜΦϒδΣΫτͷߋ৽ɺ࡟আ var params = { classname: ‘favorite_players’, fields: { name: ‘Randy W Bass’, number: 44 }, }; Cloud.Objects.update(params, function(res){ ... }); var params = { classname: ‘favorite_players’, id: '4feaf1e70020447dd304cfd0', }; Cloud.Objects.delete(params, function(res){ ... }); 2012೥8݄13೔݄༵೔
  17. Web ϕʔε GUI ... Appcelerator ͷαΠτ্ Ti.Developers.meeting vol.5 in Kyoto

    ACS ͷσʔλ؅ཧ ͳ͍͠ΐ— 2012೥8݄13೔݄༵೔
  18. Ti.Developers.meeting vol.5 in Kyoto ACS ·ͱΊ Titanium SDK 2.0 ͔Βར༻Ͱ͖Δ

    BaaS ແྉ࿮͕༻ҙ͞Ε͍ͯͯؾܰʹ࢖͑Δ ෳࡶͳઃఆ͸ෆཁɺ΄΅σϑΥϧτͰར༻Մೳ API ΞΫηε͸Α͋͘Δ Ajax ͬΆ͍ॻ͖ํ Web ϕʔεͷ GUI Ͱσʔλ؅ཧͰ͖Δ 2012೥8݄13೔݄༵೔
  19. Agenda - ACS Ͱ Sreverside non-programming Ͱ։ൃ - αϯϓϧΞϓϦͰσϞ -

    ACS ࢖ͬͯͯݱ࣌఺ͷϝϦοτʗσϝϦοτ Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  20. Agenda - ACS Ͱ Sreverside non-programming Ͱ։ൃ - αϯϓϧΞϓϦͰσϞ -

    ACS ࢖ͬͯͯݱ࣌఺ͷϝϦοτʗσϝϦοτ Ti.Developers.meeting vol.5 in Kyoto 2012೥8݄13೔݄༵೔
  21. ACS ͷϝϦοτ - ։ൃʗӡ༻ίετͷ࡟ݮɺωΠςΟϒଆʹઐ೦Ͱ͖Δ - API ઃܭ΋ҙ֎ͱ͔ͬ͠Γ͍ͯ͠Δ αʔόʔαΠυͷ։ൃ͕ෆཁ Ti.Developers.meeting vol.5

    in Kyoto - ͱΓ͋͑ͣແྉͰ࢖͑Δͷ͸ͱͯ΋͋Γ͕͍ͨ - ΦϓγϣϯΛ௥Ճͯ͠΋͓ࡒ෍ʹ༏͍͠ අ༻ͱͯ͠΋Ϧʔζφϒϧ - RESTful ͳ API ͱͯ͠ɺOAuth ʹ΋ରԠ Titanium Ҏ֎͔Β΋࢖༻Մೳ 2012೥8݄13೔݄༵೔
  22. ACS ͷσϝϦοτ - ίϯιʔϧૢ࡞ͱ͔͸ࠓͷͱ͜ΖෆՄʁ - ϩάͷࢀর΋ ... ͋ͱɺμϯϓ΋Ͱ͖ͳ͍ ... ͔͠΋ॏ͍

    ... σʔλͷ؅ཧ͕ web ্ͷΈ Ti.Developers.meeting vol.5 in Kyoto - A ͕ B ͷ࣌ʹ C Λߋ৽ͱ͍͏Α͏ͳ͜ͱ͸αʔόʔͰग़དྷͳ͍ - σʔλͷ΍ΓऔΓͷઃܭ͸γϯϓϧʹͳΒ͟ΔΛಘͳ͍ ΋ͪΖΜαʔόʔଆͰͷσʔλૢ࡞͸ෆՄ ↑ɹAPI Λར༻ͯࣗ͠લͰ࡞Ε͹Կͱ͔ͳΔʂʢ׼ 2012೥8݄13೔݄༵೔