BlaBlaCar et la mise en place dune fonctionnalité FlagFeature

Post on 23-Jan-2018

5.407 views 0 download

Transcript of BlaBlaCar et la mise en place dune fonctionnalité FlagFeature

@BlaBlaCarTech 👐

CocoaHeads

https://github.com/blablacar http://blablatech.com

Erwann Robin iOS Developer

@Diwann

iOS Developer

30€ 30€30€ 30€

120 €

30€ 30€30€ 30€

120 €

15M

10M

5M

2009 2010 2011 2012 2013 2014 2015

20M

15M

10M

5M

2009 2010 2011 2012 2013 2014 2015

20 millionmembers in 2015

...in 19 countries

...with 14 offices

@BlaBlaCarTech

Manage Apps at Home

2009

NOW

From webview to native! Keep the webview flexibility:

○ update strings without

submission

○ easily deploy features at a

specific time

CloudFront

CloudFront

CloudFront

CloudFront

10-17M requests / day 99.9%0.1%

Why this solution?

API

○ server traffic○ distribution impact

! S3/Cloudfront○ nothing to do○ distribution

User sideEN

FR

ES

...

User sideEN

FR

ES

...

User sideEN

FR

ES

...

CloudFront

Tech sideEN

FR

ES

...

CloudFront1

2015-11-13 14:03:05

Tech sideEN

FR

ES

...

CloudFront

CloudFront

304Not modified

1

2

2015-11-13 14:03:05

User sideEN

FR

ES

...

CloudFront

CloudFront

304Not modified

1

2

2015-11-13 14:03:05

10-17M requests / day

File Transfer : 16%= 1.5-2.6 To saved

Dev sideBBS3DownloaderManager : downloadFileIfModifiedSince

NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];

NSDate *lastModifiedDate = [fileAttributes fileModificationDate];

NSString *lastModifiedString = [[BBS3DownloaderManager aws3DateFormatter] stringFromDate:lastModifiedDate];

if (lastModifiedString) { [(NSMutableURLRequest*)req setAllHTTPHeaderFields:@{@"If-Modified-Since" : lastModifiedString}]; }

Dev sideBBS3DownloaderManager : downloadFileSucceed

NSString *lastModifiedString = operation.response.allHeaderFields[@"Last-Modified"];

NSDate *lastModifiedDate = [[BBS3DownloaderManager aws3DateFormatter] dateFromString:lastModifiedString];

NSDictionary *modificationDateAttr = [NSDictionary dictionaryWithObjectsAndKeys: lastModifiedDate, NSFileModificationDate, nil];

[[NSFileManager defaultManager] setAttributes:modificationDateAttr ofItemAtPath:filePath error:nil];

Dev sideBBLocalization :

- Find the right locale- Check if there is already a downloaded file

- Load local locale file ;-)- Try to refresh this file from the network and reload it

OpenLocalization

openL10n.io

Create and push new trads

Translate and distribute

WhatAbout

Features?

BBS3DownloaderManager BBLocalization

BBConfiguration / BBConfigurationManager

BBConfigurationManager

- Find the right country

- Check if there is already a downloaded config file- Load local config file

- Try to refresh this file from the network and reload it

Exemple

{ “use_regular_trip” : false, ...}

Activate a feature

{ “use_regular_trip” : false, ...}

true

Dev side

if ([BBConfigurationManager sharedManager].configuration.isRegular) { // ... }

Exemple - Activate a countrylanguage: pt

regional format: pt_BR

02/11/15

Activate a countrylanguage: pt

regional format: pt_BR

{ “fr” : {...}, “pt” : { “default”:”portugal”

}, ... }

02/11/15

Illustration - Add new countrylanguage: pt

regional format: pt_BR

{ “fr” : {...}, “pt” : { “default”:”portugal”

}, ... }

{ “france”: {...}, “portugal” : {...}, ... }

02/11/15

Illustration - Add new countrylanguage: pt

regional format: pt_BR

{ “fr” : {...}, “pt” : { “default”:”portugal”

}, ... }

{ “fr” : {...}, “pt” : { “default”:”portugal”, “pt_BR”:”brazil”

}, ... }

02/11/15

{ “france”: {...}, “portugal” : {...}, ... }

Illustration - Add new countrylanguage: pt

regional format: pt_BR

{ “fr” : {...}, “pt” : { “default”:”portugal”

}, ... }

{ “fr” : {...}, “pt” : { “default”:”portugal”, “pt_BR”:”brazil”

}, ... }

{ “france”: {...}, “portugal” : {...}, “brazil”: {...} ... }

02/11/15

{ “france”: {...}, “portugal” : {...}, ... }

RolloutOctoberSeptemberAugustJulyJune

Unexpected benefit …

! Cache application

! Request handler

! iOS version killer

➔Web based configuration tool➔App version killer➔Feature Release Date➔bare NSURLSession➔OpenSource ?

What’s next?Thanks!