Back of First Screen AB test of Hatena Bookmark iOS app with Firebase AB Testing

Back of First Screen AB test of Hatena Bookmark iOS app with Firebase AB Testing

D36d6bab8f1e0ff4bb3377571e5f7dcd?s=128

Yutaro Muta

July 22, 2019
Tweet

Transcript

  1. 2.

    • Yutaro Muta @yutailang0119 • Hatena Co., Ltd. @Kyoto •

    Conference Staff • builderscon 2017, 2018 • try! Swift Tokyo 2019, 2020 • ࠷ۙͷਪ͠͸Combine framework Who am I ?
  2. 8.
  3. 9.
  4. 15.

    A/BςετπʔϧʹٻΊͨ͜ͱ • [Must] A or Bͷ੾Γସ͑Λ֎෦ (ΞϓϦϦϦʔεαΠΫϧ֎) ͔Βߦ͑Δ • ঢ়ଶʹ߹Θͤͯը໘ଆΛ੾Γସ͑Δ

    • ςετதͷෆ۩߹΍݁Ռʹ໌Β͔ʹେ͖ͳ͕ࠩग़ͨࡍʹɺׂ߹Λมߋ • Ϗδωεతͳ͋Ε͜ΕʹରԠͰ͖ΔΑ͏ • [Better] ෼ੳπʔϧͱͷ૬ੑ΍ݕূͷ͠΍͢͞
  5. 26.

    Remote Config͔Β஋Λऔಘ // Fetch from Remote Config func fetch() {

    let expiration: TimeInterval = (60 * 60 * 3) remoteConfig.fetch(withExpirationDuration: expiration, completionHandler: nil) } // Activate fetched Remote Config settings func activateFetched() { remoteConfig.activateFetched() }
  6. 27.

    Remote ConfigͰऔಘͨ͠ઃఆ஋͔Βը໘Λग़͠෼͚Δ let viewController: UIViewController switch remoteConfig.viewSetting { case .a:

    viewController = AViewController() case .b: viewController = BViewController() } // Add to ContainerView viewController.view.translatesAutoresizingMaskIntoConstraints = false addChild(viewController) containerViewController.addSubview(viewController.view) viewController.didMove(toParent: self) NSLayoutConstraint.activate([NSLayoutConstraint]) // Switch ViewController by Remote Config let viewController: UIViewController switch remoteConfig { case .a: viewController = AViewController() case .b: viewController = BViewController() default: viewController = DefaultViewController() } // Add to ContainerView viewController.view.translatesAutoresizingMaskIntoConstraints = false addChild(viewController) containerViewController.addSubview(viewController.view) viewController.didMove(toParent: self) NSLayoutConstraint.activate([NSLayoutConstraint]())
  7. 28.
  8. 38.

    ॳճFetchͷ޻෉Ҋ 1. Fetch͕׬ྃ͢Δ·Ͱɺը໘Λwait͢Δ Pros: ॳճ΋A/Bςετͷઃఆ஋Λ൓өͰ͖Δ Cons: ଴͕ͪ࣌ؒൃੜɺFetch͕ࣦഊͨ࣌͠͸Ͳ͏͢Δʁ 2. Fetch͕׬ྃͨ͠Βଈ࠲ʹ൓өͤ͞Δ ->

    ࠷ॳ͸default஋Ͱը໘Λදࣔ -> Fetchޙ͙͢ʹ RemoteConfig.activateFetched() -> ը໘ͷߋ৽ Pros: ࣮૷্ͷߟྀ఺͸গͳ͍ Cons: Ϣʔβʔ͸࢖༻தʹUI͕มߋ͞ΕΔͷͰɺڻ͔͘΋ 3. ࣍ճىಈ࣌·Ͱ଴ͭ -> ىಈ࣌ʹͷΈ RemoteConfig.activateFetched() Pros: ࣮૷্ͷߟྀ఺͸গͳ͍ Cons: 2ճ໨Ҏ߱ͷىಈʹͨͲΓண͚ͳ͍ͱɺςετͰ͖ͳ͍