We looked into it and the problem has already been fixed in the latest build. Please update the library either from the github repository or using our pod from CocoaPods.
I have just updated the library.(I hope it’s just copying the lib folder to my project root. Not using cocoapods).
The issue has not been fixed. I’m still unable to login.
Now the login issue seems to be intermittent. Some times it logs me in, sometimes it doesn’t. I tried deleting the user on the console and also deleted the app and rebuilt.
I have a new problem now. It takes a full minute to get a response from isValidToken method!! Is there any limits on the developer account? Or am I having 2 bad days in a row?
I changed my code to use the SYNC method and I’m able to login.
I checked the github code and it looks like its using a SYNC method.
Could you please verify with the ASYNC method once? Its blocking my UI.
I dont knwo why it just working perfectly before the problem of sorted , after the sorted problem fixed i have another problem is that it work fast on stimulator but on my iphone it fetch very slow and the query is making cannot change my tab .Here my code . It stuck for a while like 5 minutes maybe and only query .
func fetchFollowUsers(){
print("Likes \(self.likes)")
print("\n============ Fetching first page using the ASYNC API ============")
let startTime = NSDate()
let whereClause = "type = 'follow' AND fromUser.objectId = '\(backendless.userService.currentUser.objectId)'" //User Can Be Query Through Object ID
let followQuery = BackendlessDataQuery()
followQuery.whereClause = whereClause
var followObjectId = [String]()
let queryOptions = QueryOptions()
queryOptions.addRelated("toUser")
queryOptions.addRelated("fromUser")
followQuery.queryOptions = queryOptions
/*
let queryOptions = QueryOptions()
queryOptions.addRelated("fromUser")
let dataQuery = BackendlessDataQuery()
dataQuery.whereClause = whereClause
dataQuery.queryOptions = queryOptions
*/
print("Should Load Here First")
//FIrst We Get All User Object id That User Have Follow
//Get All User Object Id That Follow
backendless.persistenceService.of(Activity.ofClass()).find(
followQuery,
response: { ( restaurants : BackendlessCollection!) -> () in
let currentPage = restaurants.getCurrentPage()
print("Loaded \(currentPage.count) Follow USer objects")
print("Total Follow User in the Backendless starage - \(restaurants.totalObjects)")
for followUsers in currentPage as! [Activity] {
followObjectId.append((followUsers.toUser?.objectId)!)
}
var whereClauseStatus = String()
whereClauseStatus = "user.objectId = '\(backendless.userService.currentUser.objectId)'" //User Can Be Query Through Object ID
if currentPage.count != 0 {
//Get All Image From Follow User
for var i = 1 ; i <= currentPage.count ; i++ {
print(currentPage.count)
whereClauseStatus = whereClauseStatus + "OR user.objectId = '\(followObjectId[i-1])' "
}
let followQueryStatus = BackendlessDataQuery()
followQueryStatus.whereClause = whereClauseStatus
print("Follow Object id = \(followObjectId)")
let queryOptionsStatus = QueryOptions()
queryOptionsStatus.addRelated("user")
queryOptionsStatus.sortBy(["created DESC"])
queryOptionsStatus.pageSize = 50
followQueryStatus.queryOptions = queryOptionsStatus
//We Then Get All Follow USer Status And Current User Status From It
backendless.persistenceService.of(Status.ofClass()).find(
followQueryStatus,
response: { ( restaurants : BackendlessCollection!) -> () in
let currentPage2 = restaurants.getCurrentPage()
print("Loaded \(currentPage2.count) follow objects")
print("Total Follow Status in the Backendless starage - \(restaurants.totalObjects)")
for followStatus in currentPage2 as! [Status] {
print("Object \n Restaurant name = \(followStatus.status!)")
self.status.append(followStatus.status!)
print("Check From User IS NIL\(followStatus.user?.name)")
self.user.append((followStatus.user?.name!)!)
print("Checking Date \(followStatus.created) \n")
self.date.append(followStatus.created!)
self.statusId.append(followStatus.objectId!)
print("Status ObjectId Array = \(self.statusId)")
self.objectCount++
}
self.loadUserStatus()
},
error: { ( fault : Fault!) -> () in
print("Server reported an error: --> from Photo Follows \(fault)")
}
)
self.imageView.removeFromSuperview()
print("Follow Object Id == \(followObjectId)")
}else /*From Current Page != 0 */ {
let followQueryStatus = BackendlessDataQuery()
followQueryStatus.whereClause = whereClauseStatus
print("Follow Object id = \(followObjectId)")
let queryOptionsStatus = QueryOptions()
queryOptionsStatus.addRelated("user")
queryOptionsStatus.sortBy(["created DESC"])
queryOptionsStatus.pageSize = 50
followQueryStatus.queryOptions = queryOptionsStatus
//We Then Get All Follow USer Status And Current User Status From It
backendless.persistenceService.of(Status.ofClass()).find(
followQueryStatus,
response: { ( restaurants : BackendlessCollection!) -> () in
let currentPage2 = restaurants.getCurrentPage()
print("Loaded \(currentPage2.count) follow objects")
print("Total Follow Status in the Backendless starage - \(restaurants.totalObjects)")
for followStatus in currentPage2 as! [Status] {
print("Object \n Restaurant name = \(followStatus.status!)")
self.status.append(followStatus.status!)
print("Check From User IS NIL\(followStatus.user?.name)")
self.user.append((followStatus.user?.name!)!)
print("Checking Date \(followStatus.created) \n")
self.date.append(followStatus.created!)
self.statusId.append(followStatus.objectId!)
print("Status ObjectId Array = \(self.statusId)")
self.objectCount++
}
self.loadUserStatus()
},
error: { ( fault : Fault!) -> () in
print("Server reported an error: --> from Photo Follows \(fault)")
}
)
}
},
error: { ( fault : Fault!) -> () in
print("Server reported an error: -> Follow Users Function \(fault)")
//Need Add View To Refresh When Request Time Out
}
)
}