Hi @frankm,
Preplanned offline maps are generated from the web map definition, so you would need to include the tables in the web map itself. Here's an example web map that includes a layer and a table.
You can add tables to your web map by using the Add Data option in the ArcGIS Online map viewer. For example, here's a link to a table that can be added that way: https://services.arcgis.com/OfH668nDRN7tbJh0/arcgis/rest/services/Service_with_table_test/FeatureSer...
Once the web map contains a table (and if that table belongs to a service that is offline enabled), it'll be packaged up with the rest of the preplanned map content.
However, when I say "table" above, I mean an actual table definition on the service, which is exposed in Runtime via AGSMap.tables. See this example service definition which lists both a layer and a table:
From your description, it might be the case that rather than using an explicit table, you're using a layer and just not setting a geometry on the records you put in there. If you added that to the web map, as you say, that would get added as another layer, and not as a table, and you'd access it via AGSMap.operationalLayers.
If that's the case, you have two options:
- Republish those "geometry-less" layers as tables and include them in the web map.
- Download and sync those layers in parallel with your offline map using a separate AGSGeodatabaseSyncTask.
Option 2 would involve some custom logic in your app to download and sync the geodatabase alongside the Offline Map. I.e. you would have an AGSOfflineMapTask and an AGSGeodatabaseSyncTask (or, more accurately, an AGSDownloadPreplannedOfflineMapJob and AGSGenedateGeodatabaseJob) working alongside one-another. Once downloaded, you can access the tables from the AGSGeodatabase and use them as before. When you sync the offline map with the AGSOfflineMapSyncTask, you'd also sync the downloaded geodatabase. Note that if you download the AGSGeodatabase and add the feature tables to the offline AGSMap's tables collection, then the AGSOfflineMapSyncTask should include those tables in the sync. I say "should" because I haven't tested that to confirm.
That feels like a bit of a fragile solution given the alternative, and you'd have to accommodate for a few potential error cases. There are some other nuances to this too. Happy to discuss if this is the way you decide to go. But if at all possible, I'd recommend you go for option 1.
Note, if you were downloading on-demand offline maps rather than preplanned offline maps, then you could potentially use overrides to include the additional tables that aren't part of the source web map, but then you're foregoing the benefits of preplanned offline maps.
Hope that helps.