Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 46E39200C7F for ; Tue, 9 May 2017 19:42:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 45952160B9A; Tue, 9 May 2017 17:42:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8E461160BB6 for ; Tue, 9 May 2017 19:42:23 +0200 (CEST) Received: (qmail 77363 invoked by uid 500); 9 May 2017 17:42:22 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 77269 invoked by uid 99); 9 May 2017 17:42:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2017 17:42:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 52ED7DFBAB; Tue, 9 May 2017 17:42:22 +0000 (UTC) From: shazron To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-plugin-geolocation pull request #87: Update CDVLocation.m Content-Type: text/plain Message-Id: <20170509174222.52ED7DFBAB@git1-us-west.apache.org> Date: Tue, 9 May 2017 17:42:22 +0000 (UTC) archived-at: Tue, 09 May 2017 17:42:24 -0000 Github user shazron commented on a diff in the pull request: https://github.com/apache/cordova-plugin-geolocation/pull/87#discussion_r115553911 --- Diff: src/ios/CDVLocation.m --- @@ -94,61 +94,62 @@ - (BOOL)isLocationServicesEnabled - (void)startLocation:(BOOL)enableHighAccuracy { - if (![self isLocationServicesEnabled]) { - [self returnLocationError:PERMISSIONDENIED withMessage:@"Location services are not enabled."]; - return; - } - if (![self isAuthorized]) { - NSString* message = nil; - BOOL authStatusAvailable = [CLLocationManager respondsToSelector:@selector(authorizationStatus)]; // iOS 4.2+ - if (authStatusAvailable) { - NSUInteger code = [CLLocationManager authorizationStatus]; - if (code == kCLAuthorizationStatusNotDetermined) { - // could return POSITION_UNAVAILABLE but need to coordinate with other platforms - message = @"User undecided on application's use of location services."; - } else if (code == kCLAuthorizationStatusRestricted) { - message = @"Application's use of location services is restricted."; + [self.commandDelegate runInBackground:^{ + if (![self isLocationServicesEnabled]) { --- End diff -- It's a good practice (yes I read the article). In this case, self will always be retained (it's the plugin, which is always retained until the app closes). --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org