public override void GetFeed(bool fromStart, FeedSuccess success, FeedFailed fail) { checkPermission("read_stream", () => { int pageNumber; if (fromStart || this.lastPageNumber == 0) { pageNumber = 1; } else { pageNumber = this.lastPageNumber + 1; } this.lastPageNumber = 0; FB.API("/me/feed?limit=" + DEFAULT_FEED_PAGE_SIZE + "&offset=" + DEFAULT_FEED_PAGE_SIZE * (pageNumber - 1), Facebook.HttpMethod.GET, (FBResult result) => { if (result.Error != null) { SoomlaUtils.LogDebug(TAG, "GetFeedCallback[result.Error]: " + result.Error); fail(result.Error); } else { SoomlaUtils.LogDebug(TAG, "GetFeedCallback[result.Text]: " + result.Text); SoomlaUtils.LogDebug(TAG, "GetFeedCallback[result.Texture]: " + result.Texture); JSONObject jsonFeed = new JSONObject(result.Text); SocialPageData <String> resultData = new SocialPageData <String>(); resultData.PageData = StoriesFromFBJsonObjs(jsonFeed["data"].list); resultData.PageNumber = pageNumber; this.lastPageNumber = pageNumber; JSONObject paging = jsonFeed["paging"]; if (paging != null) { resultData.HasMore = (paging["next"] != null); } success(resultData); } }); }, (string errorMessage) => { fail(errorMessage); }); }
public override void GetFeed(bool fromStart, FeedSuccess success, FeedFailed fail) { checkPermission("user_posts", () => { int pageNumber; if (fromStart || this.lastPageNumber == 0) { pageNumber = 1; } else { pageNumber = this.lastPageNumber + 1; } this.lastPageNumber = 0; FB.API("/me/feed?limit=" + DEFAULT_FEED_PAGE_SIZE + "&offset=" + DEFAULT_FEED_PAGE_SIZE * (pageNumber - 1), HttpMethod.GET, (IGraphResult result) => { if (result.Error != null) { SoomlaUtils.LogDebug(TAG, "GetFeedCallback[result.Error]: " + result.Error); fail(result.Error); } else { SoomlaUtils.LogDebug(TAG, "GetFeedCallback[result.Text]: " + result.RawResult); SoomlaUtils.LogDebug(TAG, "GetFeedCallback[result.Texture]: "+result.Texture); JSONObject jsonFeed = new JSONObject(result.RawResult); SocialPageData<String> resultData = new SocialPageData<String>(); resultData.PageData = StoriesFromFBJsonObjs(jsonFeed["data"].list); resultData.PageNumber = pageNumber; this.lastPageNumber = pageNumber; JSONObject paging = jsonFeed["paging"]; if (paging != null) { resultData.HasMore = (paging["next"] != null); } success(resultData); } }); }, (string errorMessage) => { fail(errorMessage); }); }
/// <summary> /// See docs in <see cref="SoomlaProfile.GetFeed"/> /// </summary> public override void GetFeed(bool fromStart, FeedSuccess success, FeedFailed fail) { }
/// <summary> /// See docs in <see cref="SoomlaProfile.GetFeed"/> /// </summary> public override void GetFeed(bool fromStart, FeedSuccess success, FeedFailed fail) {}
/// <summary> /// See docs in <see cref="SoomlaProfile.GetFeed"/> /// </summary> public abstract void GetFeed(bool fromStart, FeedSuccess success, FeedFailed fail);
/// <summary> /// See docs in <see cref="SoomlaProfile.GetFeed"/> /// </summary> public abstract void GetFeed(bool fromStart, FeedSuccess success, FeedFailed fail);