获取Parse中匿名用户的位置?

时间:2016-04-04 14:33:01

标签: ios swift parse-platform swift2 parse-server

我试图在Parse中获取currentUser的位置。用户是匿名用户,使用AppDelegate中的以下代码创建:

//log in the anonymous user
        PFUser.enableAutomaticUser()
        PFUser.currentUser()!.incrementKey("RunCount")
        PFUser.currentUser()!.saveInBackground()

        PFGeoPoint.geoPointForCurrentLocationInBackground {

            (geoPoint: PFGeoPoint?, error: NSError?) -> Void in

            if let geoPoint = geoPoint {

                PFUser.currentUser()?["location"] = geoPoint

                PFUser.currentUser()?.saveInBackground()
            }
        }

创建用户但在单步执行代码时跳过PFGeoPoint.geoPointForCurrentLocationInBackground块。为了保存匿名的currentUser的位置,我还需要做些什么吗?

谢谢!

0 个答案:

没有答案