python - Badoo repeat - How to determine and keep track of user's location in IOS? -
i want following.
- keep updating user's location using core location , send information database.
i creating app badoo need know user located @ times know near them.
i did following:
i put following code in applicationdidfinishlaunchwithoptions
locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; [locationmanager startupdatinglocation];
and following function in appdelegate.m
- (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation { self.currentlocation = newlocation; // send location server if(newlocation.horizontalaccuracy <= 100.0f) { [locationmanager stopupdatinglocation]; } }
is efficient way it?
how can use longitude , latitude details , django able tell near user?
thanks help!
as efficiency - depends on mean. method describe doesn't allow user start process of determining location - starts when app starts. if intent, see being efficient user not take time start it.
however, have code in appdelegate file. efficiency maintaining code, not agree pattern have provided. more efficient (in terms of development) best have separate model handle updates location manager , have appdelegate create instance of said model.
sorry - can't django.
Comments
Post a Comment