is there a method in ArcGIS Runtime SDK for iOS to get bundle version?
Not out of the box, but there is this Swift extension we published as part of the data-collection-ios Open Source app:
https://github.com/Esri/data-collection-ios/blob/1b846d7c8f19d994a83fae259ec2cceeef19be2f/data-collection/data-collection/Extensions/Foundation/Bundle%2BVersion.swift#L18-L45
extension Bundle <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">private</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">let</SPAN> agsBundle <SPAN class="operator token">=</SPAN> <SPAN class="token function">AGSBundle</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">/// An end-user printable string representation of the ArcGIS Bundle version shipped with the app.</SPAN> <SPAN class="comment token">///</SPAN> <SPAN class="comment token">/// For example, "2000"</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">var</SPAN> sdkBundleVersion<SPAN class="punctuation token">:</SPAN> String <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="punctuation token">(</SPAN>agsBundle<SPAN class="operator token">?</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">object</SPAN><SPAN class="punctuation token">(</SPAN>forInfoDictionaryKey<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"CFBundleVersion"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN><SPAN class="operator token">?</SPAN> String<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">?</SPAN><SPAN class="operator token">?</SPAN> <SPAN class="string token">"?"</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="comment token">/// An end-user printable string representation of the ArcGIS Runtime SDK version shipped with the app.</SPAN> <SPAN class="comment token">///</SPAN> <SPAN class="comment token">/// For example, "100.0.0"</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">var</SPAN> sdkVersion<SPAN class="punctuation token">:</SPAN> String <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="punctuation token">(</SPAN>agsBundle<SPAN class="operator token">?</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">object</SPAN><SPAN class="punctuation token">(</SPAN>forInfoDictionaryKey<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"CFBundleShortVersionString"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN><SPAN class="operator token">?</SPAN> String<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">?</SPAN><SPAN class="operator token">?</SPAN> <SPAN class="string token">"?"</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="comment token">/// Builds an end-user printable string representation of the ArcGIS Bundle shipped with the app.</SPAN> <SPAN class="comment token">///</SPAN> <SPAN class="comment token">/// For example, "ArcGIS Runtime SDK 100.0.0 (2000)"</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">var</SPAN> ArcGISSDKVersionString<SPAN class="punctuation token">:</SPAN> String <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="token function">String</SPAN><SPAN class="punctuation token">(</SPAN>format<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"ArcGIS Runtime SDK %@ (%@)"</SPAN><SPAN class="punctuation token">,</SPAN> sdkVersion<SPAN class="punctuation token">,</SPAN> sdkBundleVersion<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
perfect, thank you very much!
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.