iOS
Store dynamic values
Values that should be accessible by the Edge-ETL can be stored and removed with the following methods:
Kettle.setValue(key, value)
Kettle.removeValue(key)
Integrate silent push notifications
Silent push notifications are used to trigger various operations that utilize the stored dynamic values. The following example assumes native implementation of APNs, where the app has registered for push notifications.
Any relevant push notifications should be forwarded to Kettle in the didReceiveRemoteNotification
method in AppDelegate
. The relevancy of the push notification can be checked with Kettle.isSilentNotification()
, and if so, the event can be forwarded with Kettle.shared.handlePushNotification()
. Make sure background push is enabled for the app and that the app has called registerForRemoteNotifications
.
-(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void
(^)(UIBackgroundFetchResult))completionHandler
{
if ([KTLKettle isSilentNotificationWithUserInfo:userInfo]) {
[[KTLKettle shared] handlePushNotificationWithDidReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
} else {
completionHandler(UIBackgroundFetchResultNoData);
}
}