public async Task MarkNewsAsRead(News news) { news.localData = new News.LocalData() { isRead = true }; await localCache.Set(news.key, news.localData); }
public void TrackEvent(string category, string action, params object[] args) { var e = new AppFlowEvent() { cat = category, action = action, args = args }; store.Set(e.time + "__" + category + "-" + action + ".json", e).LogOnError(); }
public async Task <FeatureFlag> GetFeatureFlag(string featureId) { FeatureFlag flag = await store.Get(featureId, null); if (flag != null && flag.localState.randomPercentage == 0) { // if the server decided its a staged rollout no rnd % generated yet so do it: flag.localState.randomPercentage = new Random().Next(1, 100); await store.Set(flag.id, flag); // save in local store } return(flag); }
public void TrackEvent(string category, string action, params object[] args) { var e = new AppFlowEvent() { cat = category, action = action, args = args }; store.Set(e.time + "__" + category + ":" + action, e).OnError((exeption) => { Log.e(exeption); return(Task.FromException(exeption)); }); }
private async Task <T> ReturnInitializedFlag(T flag) { if (flag != null) { AssertV2.IsNotNull(flag.localState, "flag.localState"); if (flag.localState.randomPercentage == 0) { // if the server decided its a staged rollout no rnd % generated yet so do it: flag.localState.randomPercentage = new Random().Next(1, 100); await featureFlagStore.Set(flag.id, flag); // save in local store } } return(flag); }