lime - push notifications. the big way
TRANSCRIPT
![Page 1: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/1.jpg)
![Page 2: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/2.jpg)
PETR DVOŘÁKCEO at Lime
![Page 3: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/3.jpg)
Push notifications. The big way.
![Page 4: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/4.jpg)
Should be part of every app.
Are not part of every app.
Are simple when done simple.
Mostly, they are pretty hard.
Push notifications
![Page 5: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/5.jpg)
Why?
![Page 6: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/6.jpg)
Users who opt in to push messages averaged 3x more app launches than those who opted out.
— Localytics
![Page 7: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/7.jpg)
65% of users returned to an app in the 30 days after the app’s initial download, if they have push enabled.
— Localytics
![Page 8: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/8.jpg)
Forced social login
Privacy concerns
Intrusive ads
Bad UI/UX
Freezing
Complex sign-up
Annoying notifications
0 20 40 60 80
71%
68%
48%
42%
29%
23%
19%
Top 7 reasons why people uninstall mobile apps
Source: Appiterate Survey, as % of all respondent (each respondent picked 3 reasons)
![Page 9: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/9.jpg)
Personalized and relevant content.
Delivered in the right time.
Spamming users results in uninstalls.
Test, measure, improve.
Automate engagement.
When it works?
![Page 10: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/10.jpg)
Utility & Finance
Taxi & Ride sharing
Travel & Hospitality
Sport
Food & Beverage
Media
Social
Retail & e-commerce
0 10 20 30 40
11%
13%
19%
25%
26%
29%
30%
40%
Push notification engagement by industry
Source: Kahuna
![Page 11: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/11.jpg)
In 2015, 49.8% of app users opted in to receiving push notifications. In 2014, it was 52.0%.
— Localytics
![Page 12: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/12.jpg)
Soft on-boarding, trust …
![Page 13: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/13.jpg)
Implementation topics
![Page 14: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/14.jpg)
APNs / GCM
Provider
![Page 15: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/15.jpg)
1. Register device at APNs and provider.
2. Identify (or segment) users.
3. Send push notifications.
4. Analyze data.
5. Remove unused devices.
What needs to be done?
![Page 16: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/16.jpg)
Device registration
![Page 17: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/17.jpg)
Registration
APNs
Provider
1. Ask for APNs token.
2. Get APNs token
3. Send APNs token to provider
![Page 18: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/18.jpg)
APNs token
User identifier
Push notification settings
User demographics
User location
… and much more :-)
Data sent to provider
![Page 19: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/19.jpg)
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIUserNotificationSettings *set = [UIUserNotificationSettings settingsForTypes:types categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:set]; [[UIApplication sharedApplication] registerForRemoteNotifications]; }
AppDelegate.m
Register for remote notifications
![Page 20: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/20.jpg)
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken { self.registered = YES; [self sendProviderDeviceToken:devToken]; // custom method } - (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err { NSLog(@"Error in registration. Error: %@", err); }
AppDelegate.m
Register for remote notifications
![Page 21: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/21.jpg)
Sending notifications
![Page 22: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/22.jpg)
Send push notifications
APNs
Provider
1. Decide to send push
2. Send payload and APNs token
3. Deliver the push message
![Page 23: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/23.jpg)
Push notification payload
{ "aps" : { "alert" : { "title" : "Hello there!", "body" : "It has been a while." } } }
Maximum payload length is 4096 bytes.
![Page 24: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/24.jpg)
Ehm… security?Push Certificate (*.pem, *.p12)
![Page 25: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/25.jpg)
![Page 26: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/26.jpg)
![Page 27: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/27.jpg)
![Page 28: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/28.jpg)
$ openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts
![Page 29: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/29.jpg)
Provider code
![Page 30: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/30.jpg)
$pushManager = new PushManager(PushManager::ENVIRONMENT_DEV);
$apnsAdapter = new ApnsAdapter(array( 'certificate' => '/path/to/your/apns-certificate.pem', ));
$devices = new DeviceCollection(array( new Device('???????') ));
$message = new Message('Hello guys!');
$push = new Push($apnsAdapter, $devices, $message); $pushManager->add($push); $pushManager->push();
Send push notifications
![Page 31: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/31.jpg)
Application code
![Page 32: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/32.jpg)
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UILocalNotification *remoteNotif = launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; NSDictionary *userInfo = remoteNotif.userInfo;
}
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
}
Handle push notifications
![Page 33: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/33.jpg)
Feedback service
![Page 34: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/34.jpg)
Feedback service
APNs
Provider
1. Request expired tokens
2. Expired token list
3. Delete tokens
![Page 35: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/35.jpg)
$pushManager = new PushManager(PushManager::ENVIRONMENT_DEV);
$apnsAdapter = new ApnsAdapter(array( 'certificate' => '/path/to/your/apns-certificate.pem', ));
$feedback = $pushManager->getFeedback($apnsAdapter); // $feedback contains collection of [device_token, timestamp] pairs
Clean up device tokens
![Page 36: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/36.jpg)
Silent push notifcation
Interactive actions
Localization
Badge number
Custom sound
Extras
![Page 37: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/37.jpg)
Scaling big
![Page 38: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/38.jpg)
User management - fast segmentation… by what?
Delivery time - 100k devices x 4096 … 1M devices?
Multiple apps - Reusing the push server
Hardware and infrastructure
Engineering - project grows big, multiple platforms
Dimensions of scaling
![Page 39: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/39.jpg)
APNS / GCM
Provider
![Page 40: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/40.jpg)
APNs
Provider (business logic)
GCM
SDK SDK
APP KEY
App Management Service Device Registration Service User Segmentation Service
Analytics Data Service
APNS Node GCM Node
APP KEYAPP KEY
![Page 41: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/41.jpg)
1. Create campaign object
2. Select the audience
3. Send notifications
4. Collect analytics
Campaign planning
![Page 42: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/42.jpg)
APNs
Provider (business logic)
GCM
SDK SDKApp Management Service Device Registration Service User Segmentation Service
Analytics Data Service
MongoDBMongoDBMongoDB
APNS Node GCM Node
N instances
Partitioning
![Page 43: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/43.jpg)
APNs GCM
SDK SDKAPI, admin, workers
![Page 44: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/44.jpg)
IBM Bluemix - price, HW scaling, connectivity, …
MongoDB - performance, queries, … (Compose)
Node.js - for “nodes”, speed, efficiency, …
RESTful API - standards, easy to work with, … (PHP, Nette)
Server Technologies at Lime
![Page 45: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/45.jpg)
Device registration
Push notification processing
UI Features
User profile synchronization
Location monitoring
Analytics
Lime - Mobile SDK
![Page 46: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/46.jpg)
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { LimeEngate *lime = [LimeEngage sharedInstance];
[lime startFetchingContextForApplicationKey:@"app_8cb31c49a46df1fea11"];
[lime handleRemoteNotificationInfo:[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]]; return YES; }
Set up Lime SDK
![Page 47: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/47.jpg)
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
LimeEngage *lime = [LimeEngage sharedInstance]; [lime handleRemoteNotificationInfo:userInfo];
}
Handle notifications
![Page 48: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/48.jpg)
LimeEngage *lime = [LimeEngage sharedInstance];
lime.currentUser.internalId = @"4378924"; lime.currentUser.name = @"Jan"; lime.currentUser.surname = @"Novak"; lime.currentUser.sex = @"male";
[lime synchronizeCurrentUser];
Update user info
![Page 49: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/49.jpg)
Demo
![Page 50: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/50.jpg)
![Page 51: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/51.jpg)
![Page 52: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/52.jpg)
![Page 53: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/53.jpg)
![Page 54: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/54.jpg)
Open-source04/2016
![Page 55: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/55.jpg)
Thank you! :)
@joshis_tweets http://getlime.io/
![Page 56: Lime - Push notifications. The big way](https://reader033.vdocument.in/reader033/viewer/2022051502/58ee316c1a28ab3d538b45e1/html5/thumbnails/56.jpg)
WWW.MDEVTALK.CZ
mdevtalk