iOS Load TPK from Shared Container

1135
3
10-11-2016 10:24 AM
NathanWorcester
New Contributor

I have 2 apps that are trying to share the same TPK offline base map.  I have App Groups enabled in xCode and have the TPK file stored in the shared container but it does not seem to work when referencing the file with AGSLocalTiledLayer.  I am using ArcGIS RUntime SDK for iOS 10.2.4

The error message I see says "Cache at path '(null)' not found"

Does anyone know if it is possible to have a TPK file stored in the shared container and referenced by multiple apps?  The reason we are looking to do this is that our basemap is around 1GB and we don't want to have to bundle it into multiple apps.

0 Kudos
3 Replies
MichaelDavis3
Occasional Contributor III

I'm very curious to know if this is possible - our current solution is to just buy really big iPads 🙂

0 Kudos
JohnCovele
New Contributor

yes, it is!

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

From code perspective, I think this can be done as along as you pass the right path of the tpk.

Try to download this sample shows how to access tpk file using path: 

Dropbox - LocalTiledLayer-Swift.zip 

Also, try this two line of code to load a file from your Documents directory, for example:

 let path = "/Users/goldenlimit/Documents/iOS/Case/LocalTiledLayer-Swift/"
 let tpkpath = (path as NSString).stringByAppendingPathComponent("SanFrancisco.tpk")‍‍‍‍
0 Kudos