@cbarkerms
When making calls to a function such as GetUserPhotosByAlbumIdAsync, is there a mechanism in place to support paging ? I ask because I noticed the use of the FBPaginatedArray object in the source code.
Ping @cbarkerms
Pinged! :)
not supported right now on GetUserPhotosByAlbumIdAsync(). if this is an urgent requirement, you can reach into the underlying provider (FacebookService.Provider) in order to utilize FBPaginatedArray. We can add this as a feature request for a subsequent version of FacebookService.
Ok, thanks for the reply. Yes this would be a great feature to have, not a rush for now. In the meantime I'll look at the source code and see if I can come up with something. Please add this as a feature request. Thanks!
I MIGHT have an idea. I'll test it out and report back with some code if it works.
@cbarkerms
Unfortunately my idea didn't work. Just for the sake of trying it, I had added the following function in FacebookService (since GetUserPhotosByAlbumIdAsync calls RequestAsync which in turn uses a FBPaginatedArray):
public async Task<List<T>> FetchNextPaginatedResults<T>()
{
List<T> processedResults = new List<T>();
if (paginatedArray.HasNext)
{
var nextResult = await paginatedArray.NextAsync();
if (nextResult.Succeeded)
{
IReadOnlyList<object> nextResults = (IReadOnlyList<object>)nextResult.Object;
foreach (T result in nextResults)
{
processedResults.Add(result);
}
}
}
return processedResults;
}
What I basically tried was to call this function when I scrolled to the end of my GridView to fetch more photos, but I ended up with an error in Fiddler:
message=(#100) Tried accessing nonexisting field (album) on node type (URL)
I think you have stumbled upon a bug in https://github.com/Microsoft/winsdkfb :) I am just validating with that team. When we do this for real, we should probably leverage IncrementalLoadingCollection/IIncrementalSource. I have a prototype which is not too far off, but I hit the above issue also. Will update when I know more.
Congrats @assassin316 You deserve a sticker for that :D
@cbarkerms don't forget this toolkit now has implementations for IIncrementalLoading
Wow, glad I found one :) and this is my first attempt at a GitHub contribution LOL
Thanks for catching! :) The team have root caused the issue now so we are just awaiting news on fix timeframe - I'll update as I hear more.
@cbarkerms
Thanks! Can we also tag this as a Feature Request, it would make sense to support paging :)
done! re:bug - I tested a private fix from the team yesterday but still had issues - working through with them currently
Oh, one more thing since I have it on my mind, I'll mention it here so we don't forget. Paging should be applicable to api calls such as GetAlbums... and GetPhotos... etc.
I'm mentioning that because I'm currently working with the Flickr API and they do exactly that, which makes sense. Their api calls always have a "page" and "pageSize" parameter for pagination.
Do you plan to submit a service for flickrApi? (jsut asking :))
Actually I'm using the Flickr-Net project which is also on GitHub, would be nice though if the owner moved it into this project:
Ping @samjudson to get his thoughts :)
Hi
I've had a look through the services offered currently, and it might be interesting to provide a basic Flickr service too, but I don't think you'd want everything in there. The Facebook service doesn't cover the entire facebook graph api, just certain parts.
If anyone has any suggestions as to what parts might make a good sub-set I could have a look at it.
Perhaps take this into another issue, as its not Facebook related anymore.
Keep in mind the Flickr-Net library supports UWP (I think - at least according to a recent post by someone - haven't actually tried it myself).
Yes it works in UWP. :)
In my UWP app, I'm able to authenticate the user, get his/her photosets (in a paged manner), and get the photos of a photoset (in a paged manner). So far it works great, I haven't expanded beyond those api calls yet.
I had OAuth problems but @samjudson had an experimental sample that helped a lot.
I personally would love to see post to Flickr, and the ability to get profile information. Beyond that I think there are apps that do it for me. But if I am making a photo app and want to share to Flickr (and maybe add tags, Groups, etc). I think that is the primary scenario. I agree it is much like the Facebook needs (basic, not breadth coverage).
I'd like to also ping @fujiy from Microsoft Brazil who is the lead on the InstaSharp Api for Instagram (https://github.com/InstaSharp/InstaSharp). That would also be a welcome addition to the UWP Community project.
Hey guys, I would like to see InstaSharp in UWP Community Toolkit, the problem is testing. I'm not updating InstaSharp anymore because Instagram limited the endpoints I can call without a Non-Sandboxed Client Id, so I have no way to update and test the api calls.
Please let me know if this meets requirements for FB paging support.
For the other services requested, please open a separate issue.
That looks great! If I stumble upon bugs or issues. I'll open a seperate bug, thanks for the update! :) Go ahead and close the issue.
Most helpful comment
Do you plan to submit a service for flickrApi? (jsut asking :))