setLiveDataSource static method

GemError setLiveDataSource()

Sets the PositionService to use the device's live GPS data source.

Call this after the app has the required location permission. Setting the live data source instructs the SDK to use the device GPS as the primary provider for position updates and listener callbacks. Calling this method more than once can return GemError.exist.

Returns

Also see:

Implementation

static GemError setLiveDataSource() {
  final String resultString = GemKitPlatform.instance
      .callObjectMethod(<String, Object>{
        'id': 0,
        'class': 'PositionService',
        'method': 'selectPositionDataSource',
        'senseDataSourceType': 'live',
      });
  final dynamic result = jsonDecode(resultString);
  final int errCode = result['gemApiError'];
  return GemErrorExtension.fromCode(errCode);
}