I'm using MSGraphSDK to get all users using the Microsoft Graph - but I can only get the first batch of users (default batch size is 100). I am able to get the first batch as shown below, but I can't see how the framework supports getting the next batch...
func getUsers(...) {
var i = 0
self.graphClient.users().request().getWithCompletion{
(collection:MSCollection?, nextLink:MSGraphUsersCollectionRequest?, error:Error?) in
if let nsError = error {
NSLog("failed - message: \(nsError.localizedDescription)")
} else {
if let users = collection {
for user: MSGraphUser in users.value as! [MSGraphUser] {
i = i+1
print("\(i): \(user.optDisplayName ?? "<empty>")")
self.save(user)
}
// TODO: Handle next batch...
if users.nextLink != nil {
//self.getNextUsers(users.nextLink)
}
}
}
}
}