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

Introducing Realm Mobile Platform

Introducing Realm Mobile Platform

Introducing Realm Mobile Platform

Kishikawa Katsumi

October 20, 2016
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

  1. Realm meetup #2
    [email protected]

    View Slide

  2. View Slide

  3. Katsumi Kishikawa
    Realm Inc.
    [email protected]

    View Slide

  4. Realm Mobile Platform

    [email protected]

    View Slide

  5. Open Sourcing Realm Core

    [email protected]

    View Slide

  6. What is
    Realm Mobile Platform?
    [email protected]

    View Slide

  7. Realm
    ˖ 42-JUFך➿剏הז׷ٌغ؎ٕرغ؎أ㼔欽ך
    ر٦ةك٦أ
    ˖ ؙٗأفٓحزؿؓ٦ي
    ˖ J04"OESPJE
    ˖ +BWB 4XJGU 0CKFDUJWF$ $ +BWB4DSJQU
    ˖ ؔ٦فٝا٦أ
    [email protected]

    View Slide

  8. Realm Mobile Database
    [email protected]
    ˖ 42-JUFך➿剏הז׷ٌغ؎ٕرغ؎أ㼔欽ך
    ر٦ةك٦أ
    ˖ ؙٗأفٓحزؿؓ٦ي
    ˖ J04"OESPJE
    ˖ +BWB 4XJGU 0CKFDUJWF$ $ +BWB4DSJQU
    ˖ ؔ٦فٝا٦أ

    View Slide

  9. [email protected]
    Realm Mobile Platform

    View Slide

  10. [email protected]
    Realm Mobile Platform
    Realm Mobile
    Database

    View Slide

  11. Realm Mobile Platform
    [email protected]
    Realm Mobile
    Database
    Data Sync
    ٔ،ٕة؎يず劍

    View Slide

  12. Realm Mobile Platform
    [email protected]
    Realm Mobile
    Database
    Data Sync
    User Identify
    ٔ،ٕة؎يず劍
    ِ٦ؠ٦陎ⴽ

    View Slide

  13. Realm Mobile Platform
    [email protected]
    Realm Mobile
    Database
    Data Sync Access Control
    User Identify
    ٔ،ٕة؎يず劍
    ِ٦ؠ٦陎ⴽ
    ر٦ةⰟ剣

    View Slide

  14. Realm Mobile Platform
    [email protected]
    Realm Mobile
    Database
    Data Sync Access Control
    User Identify Event Handling
    ٔ،ٕة؎يず劍
    ِ٦ؠ٦陎ⴽ
    ر٦ةⰟ剣
    ؽآطأٗآحؙ

    View Slide

  15. Realm Mobile Platform
    [email protected]
    [email protected]
    Realm Mobile Database

    View Slide

  16. View Slide

  17. ࢖ͬͯΈΔ
    [email protected]

    View Slide

  18. View Slide

  19. Realm Object ServerΛىಈ͢Δ
    [email protected]
    [email protected]

    View Slide

  20. AdminΞΧ΢ϯτΛ࡞Δ
    [email protected]

    View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. Object Server্ͷσʔλΛݟΔ
    [email protected]

    View Slide

  26. View Slide

  27. View Slide

  28. ΞΫηετʔΫϯʢmacOSʣ
    [email protected]
    [email protected]

    View Slide

  29. ΞΫηετʔΫϯʢCentOSʣ
    [email protected]
    [email protected]
    # cd /etc/realm/
    # ls
    admin_token.base64 configuration.yml token-
    signature.key token-signature.pub
    # cat admin_token.base64
    ewoJImlkZW50a...

    View Slide

  30. جຊతͳ࢖͍ํ
    [email protected]
    [email protected]
    User.authenticate(with: Credential.usernamePassword(username: "username",
    password: "password",
    actions: []),
    server: URL(string: "http://128.199.141.202:9080")!, onCompletion: { user, error in
    guard let user = user else {
    fatalError(String(describing: error))
    }
    let configuration = Realm.Configuration(
    syncConfiguration: (user, URL(string: "realm://128.199.141.202:9080/~/realmtasks")!)
    )
    self.realm = try! Realm(configuration: configuration)
    })

    View Slide

  31. View Slide

  32. FacebookϩάΠϯ
    [email protected]
    [email protected]
    func loginButton(loginButton: FBSDKLoginButton!,
    didCompleteWithResult result: FBSDKLoginManagerLoginResult!,
    error: NSError!) {
    if let _ = error {
    return
    }
    if result.isCancelled {
    return
    }
    User.authenticate(with: Credential.facebook(token: result.token.tokenString),
    server: URL(string: "http://128.199.141.202:9080")!, onCompletion: { user, error in
    guard let user = user else {
    fatalError(String(describing: error))
    }
    let configuration = Realm.Configuration(
    syncConfiguration: (user, URL(string: "realm://128.199.141.202:9080/~/realmtasks")!)
    )
    self.realm = try! Realm(configuration: configuration)
    })
    }

    View Slide

  33. FacebookϩάΠϯ
    [email protected]
    [email protected]
    developers.facebook.com/docs/facebook-login/ios

    View Slide

  34. Typical Mobile App Development
    [email protected]
    /login /tasks /tasks/id

    View Slide

  35. w/ Realm Mobile Platform
    [email protected]

    View Slide

  36. Data Sync
    [email protected]
    ر٦ةず劍

    View Slide

  37. User Identify
    [email protected]
    ر٦ةず劍
    ِ٦ؠ٦陎ⴽ

    View Slide

  38. Access Control
    [email protected]
    ر٦ةず劍
    ِ٦ؠ٦陎ⴽ
    ،ؙإأ؝ٝزٗ٦ٕ

    View Slide

  39. Event Handling
    [email protected]
    ؎كٝزعٝسؚٔٝ

    View Slide

  40. ΠϕϯτϋϯυϦϯά
    [email protected]
    var Realm = require('realm');
    var filter_callback = function(realm_name) {
    ...
    };
    var change_notification_callback = function(realm_name, realm) {
    var channels = realm.objects('Channel');
    for (var i = 0; i < channels.length; ++i) {
    var channel = channels[i];
    ...
    }
    };
    Realm.setGlobalSyncListener(local_root_dir, server_base_url, access_token,
    filter_callback, change_notification_callback);

    View Slide

  41. View Slide

  42. Realm Mobile Platform
    ˖ .PCJMF%BUBCBTF
    ˖ ⿽倯ぢךر٦ةず劍
    ˖ ٔ،ٕة؎ي
    ˖ ء٦يٖأ
    ˖ ؝ٝؿؙٔزך荈⹛鍑寸
    ˖ ِ٦ؠ٦陎ⴽ
    ˖ ؎كٝزعٝسؚٔٝ
    • αʔόʔϓογϡ
    • σʔλڞ༗
    • ΞΫηείϯτϩʔϧ
    [email protected]

    View Slide

  43. ίϯϑϦΫτͷղܾ
    [email protected]
    [email protected]
    • جຊ͸ޙউͪ
    • ಉ͡ΞΠςϜʹผͷมߋΛՃ͑ͨ৔߹ɺޙʹىͬͨ͜มߋ͕࠾༻
    ͞Ε·͢ɻ
    • ಉ͡ΠϯσοΫε΁ͷૠೖ͸࣌ؒॱʹͳΔ
    • ࡟আ͸͢΂ͯʹউͭ
    • ͋ΔΞΠςϜ͕࡟আ͞ΕͯɺผͷσόΠεͰ͸ಉ͡ΞΠςϜΛมߋ
    ͨ͠ɺͱ͍͏৔߹͸ɺ࡟আ͚͕ͩى͜Γ·͢ɻ

    View Slide

  44. Demo
    github.com/realm/RealmTasks
    [email protected]

    View Slide

  45. Recent Updates
    [email protected]

    View Slide

  46. Recent Updates
    • Realm Objective-C/Swift 2.0 (was 1.1.0)
    • Realm Java 2.0 (was 1.1.0)
    • Realm React Native 0.14.0
    • Realm Xamarin 0.78 (was 0.77.2)
    [email protected]

    View Slide

  47. Realm Objective-C/Swift 2.0
    [email protected]

    View Slide

  48. Realm Objective-C/Swift 2.0
    • Realm Mobile PlatformରԠ
    • RealmSwift.Error => RealmSwift.Realm.Error
    [email protected]
    [email protected]

    View Slide

  49. Where to find us
    • % Realm Japan User Group: facebook.com/groups/realmjp
    • % Twitter: twitter.com/realmJapan
    • GitHub: github.com/realm
    • % StackOverflow: ja.stackoverflow.com/questions/tagged/realm
    • % Email: [email protected]
    • % Slack: slack.realm.io/
    [email protected]

    View Slide

  50. Realm Japan User Group
    Facebook
    [email protected]

    View Slide

  51. Support Chat
    Slack
    [email protected]

    View Slide

  52. Ξϯέʔτ
    bit.ly/RealmJP_Kansai2
    [email protected]

    View Slide

  53. Questions?
    Katsuma Kishikawa
    [email protected]
    www.realm.io/jp
    @k_katsumi

    View Slide