66#include " ../services.hh"
77#include " permissions.hh"
88
9- using ssc::runtime::config::getUserConfig;
10- using ssc::runtime::string::replace;
11-
129namespace ssc ::runtime::core::services {
1310 bool Permissions::hasRuntimePermission (const String& permission) const {
1411 return this ->context .getRuntime ()->hasPermission (permission);
@@ -263,16 +260,16 @@ namespace ssc::runtime::core::services {
263260 }
264261
265262 if (name == " geolocation" ) {
266- JSON::Object json;
263+ __block JSON::Object json;
267264
268265 #if SOCKET_RUNTIME_PLATFORM_APPLE
269- const auto performedActivation = [this ->core -> geolocation .locationObserver attemptActivationWithCompletion: ^(BOOL isAuthorized) {
266+ const auto performedActivation = [this ->services . geolocation .locationObserver attemptActivationWithCompletion: ^(BOOL isAuthorized) {
270267 if (!isAuthorized) {
271268 auto reason = @(" Location observer could not be activated" );
272269
273- if (!this ->core -> geolocation .locationObserver .locationManager ) {
270+ if (!this ->services . geolocation .locationObserver .locationManager ) {
274271 reason = @(" Location observer manager is not initialized" );
275- } else if (!this ->core -> geolocation .locationObserver .locationManager .location ) {
272+ } else if (!this ->services . geolocation .locationObserver .locationManager .location ) {
276273 reason = @(" Location observer manager could not provide location" );
277274 }
278275
@@ -281,7 +278,7 @@ namespace ssc::runtime::core::services {
281278
282279 if (isAuthorized) {
283280 json[" data" ] = JSON::Object::Entries {{" state" , " granted" }};
284- } else if (this ->core -> geolocation .locationObserver .locationManager .authorizationStatus == kCLAuthorizationStatusNotDetermined ) {
281+ } else if (this ->services . geolocation .locationObserver .locationManager .authorizationStatus == kCLAuthorizationStatusNotDetermined ) {
285282 json[" data" ] = JSON::Object::Entries {{" state" , " prompt" }};
286283 } else {
287284 json[" data" ] = JSON::Object::Entries {{" state" , " denied" }};
0 commit comments