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

Try Realm Mobile Platform

fromkk
October 18, 2016

Try Realm Mobile Platform

2016/10/18にTimers Inc.で開催されたFirebase.ebisuで発表した資料です

fromkk

October 18, 2016
Tweet

More Decks by fromkk

Other Decks in Programming

Transcript

  1. About me • Kazuya Ueoka (͔ͬ͘Μ) • @fromkk • Twitter

    / Github / Qiita • Timers Inc. iOS Team • Blog http://fromkk.me • Facebook Kazuya Ueoka (C) fromkk 2
  2. Why Realm? • 9/27 ʹൃද͞ΕͨΫϥΠΞϯτ㱻αʔόʔ׬શಉظσʔλϕʔ ε(Firebase DatabaseͷϥΠόϧͳͷͰ͸) • iOS /

    Android౳ʹରԠʢFirebase΋ʣ • αʔόʔ͸ࣗ෼Ͱ༻ҙ͢ΔͷͰσʔλϕʔεࣗମ͸ແྉͰར༻ग़ དྷΔʂ(Firebase͸͍ͣΕ༗ྉʹͳΔ) (C) fromkk 6
  3. Features of Realm • Offline first • Fast queries •

    Safe threading • Cross platform(iOS/Android/Xamarin/ReactNative) • Encrypty • Reactive (C) fromkk 8
  4. How it works Sync Engine / Object Store / Dashboard

    / Mobile Database / Event Framework / Authentication System / Access Control (C) fromkk 10
  5. Install ex: CentOS 7 # Setup Realm's PackageCloud repository curl

    -s https://packagecloud.io/install/repositories/realm/realm/script.rpm.sh | sudo bash # Install the Realm Object Server sudo yum -y install realm-object-server-de # Enable and start the service sudo systemctl enable realm-object-server sudo systemctl start realm-object-server Ҿ༻ (C) fromkk 11
  6. Realm Swift Usage // Authenticating the User SyncUser.authenticate(with: .google(token: "google

    token"), server: URL(string: "http://realm.example.com:9080")!) { user, error in if let user = user { // Opening a remote Realm let realmURL = URL(string: "realm://realm.example.com:9080/~/userRealm")! let config = Realm.Configuration(syncConfiguration: (user, realmURL)) Realm.Configuration.defaultConfiguration = config let realm = try! Realm() // Any changes made to this Realm will be synced across all devices! } else if let error = error { // handle error } } Ҿ༻ (C) fromkk 16