@@ -1336,6 +1336,30 @@ Exec_stat MCHandleSensorAvailable(void *p_context, MCParameter *p_parameters)
13361336 return ES_ERROR;
13371337}
13381338
1339+ Exec_stat MCHandleAllowBackgroundLocationUpdates (void *p_context, MCParameter *p_parameters)
1340+ {
1341+ MCExecContext ctxt (nil, nil, nil);
1342+ ctxt . SetTheResultToEmpty ();
1343+
1344+ bool t_allow_background_location_updates = false ;
1345+
1346+ if (p_parameters)
1347+ {
1348+ MCAutoValueRef t_value;
1349+ MCAutoBooleanRef t_bool;
1350+ p_parameters->eval_argument (ctxt, &t_value);
1351+ if (ctxt . ConvertToBoolean (*t_value, &t_bool))
1352+ t_allow_background_location_updates = MCValueIsEqualTo (*t_bool, kMCTrue );
1353+ }
1354+
1355+ MCSensorAllowBackgroundLocationUpdates (ctxt, t_allow_background_location_updates);
1356+
1357+ if (!ctxt . HasError ())
1358+ return ES_NORMAL;
1359+
1360+ return ES_ERROR;
1361+ }
1362+
13391363Exec_stat MCHandleCanTrackLocation (void *p_context, MCParameter *p_parameters)
13401364{
13411365 MCExecContext ctxt (nil, nil, nil);
@@ -4555,6 +4579,7 @@ static const MCPlatformMessageSpec s_platform_messages[] =
45554579
45564580 // MM-2012-02-11: Added support old style senseor syntax (iPhoneEnableAcceleromter etc)
45574581 /* DEPRECATED */ {false , " iphoneCanTrackLocation" , MCHandleCanTrackLocation, nil},
4582+ {false , " iphoneAllowBackgroundLocationUpdates" , MCHandleAllowBackgroundLocationUpdates, nil},
45584583
45594584 // PM-2014-10-07: [[ Bug 13590 ]] StartTrackingLocation and StopTrackingLocation must run on the script thread
45604585 /* DEPRECATED */ {true , " iphoneStartTrackingLocation" , MCHandleLocationTrackingState, (void *)true },
0 commit comments