<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Michael</title>
    <description>The latest articles on DEV Community by Michael (@marchbold).</description>
    <link>https://dev.to/marchbold</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F281407%2Fdf8ec0b8-0450-4f53-9c94-6ca67556bddc.png</url>
      <title>DEV Community: Michael</title>
      <link>https://dev.to/marchbold</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marchbold"/>
    <language>en</language>
    <item>
      <title>Accessing User GDPR Settings in AIR</title>
      <dc:creator>Michael</dc:creator>
      <pubDate>Wed, 15 Jun 2022 01:27:13 +0000</pubDate>
      <link>https://dev.to/marchbold/accessing-user-gdpr-settings-in-air-3che</link>
      <guid>https://dev.to/marchbold/accessing-user-gdpr-settings-in-air-3che</guid>
      <description>&lt;p&gt;At some point in your application development when you start to store and share data you will need to handle user GDPR settings. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The General Data Protection Regulation (GDPR) is a European Union (EU) regulation that mandates how an organisation should handle personal data. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you use personalised advertising or store user related data on your server then you will need to address GDPR concerns in your application.&lt;/p&gt;

&lt;p&gt;On mobile devices the GDPR settings are stored through the &lt;strong&gt;IAB Europe Transparency &amp;amp; Consent Framework&lt;/strong&gt;. This framework ensures settings are stored in consistent places for developers to access and determine their appropriate behaviour for the user.&lt;/p&gt;

&lt;p&gt;These values are stored in &lt;a href="https://developer.apple.com/documentation/foundation/nsuserdefaults#1664798?language=objc"&gt;NSUserDefaults&lt;/a&gt; on iOS and in &lt;a href="https://developer.android.com/training/data-storage/shared-preferences.html"&gt;SharedPreferences&lt;/a&gt; on Android.&lt;/p&gt;

&lt;p&gt;With the AIR SDK we can access these values easily through the &lt;a href="https://airnativeextensions.com/extension/com.distriqt.Application"&gt;Application extension&lt;/a&gt;. The Application extension allows access to the NSUserDefaults and the SharedPreferences through the &lt;a href="https://docs.airnativeextensions.com/docs/application/defaults"&gt;&lt;code&gt;defaults&lt;/code&gt;&lt;/a&gt; functionality.&lt;/p&gt;

&lt;p&gt;Firstly, we set the &lt;code&gt;useSharedDefaults&lt;/code&gt; flag to ensure we use the application's shared values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight actionscript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;defaults&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useSharedDefaults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If we don't set this flag, then the values retrieved through the &lt;code&gt;defaults&lt;/code&gt; functionality will be isolated from values set via other methods and you won't retrieve the correct TC data values. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you have set this flag you can retrieve any of the TC data from the framework by using the appropriate key. &lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight actionscript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
    &lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;defaults&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
        &lt;span class="nx"&gt;getString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;"IABTCF_TCString"&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then use this value as required for your implementation of GDPR in your application.&lt;/p&gt;

&lt;p&gt;For a full list of the available keys and a description of the values and types see the &lt;a href="https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#what-is-the-cmp-in-app-internal-structure-for-the-defined-api"&gt;documentation here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>airsdk</category>
      <category>gdpr</category>
      <category>ane</category>
      <category>advertising</category>
    </item>
    <item>
      <title>Updating an AIR Project using APM</title>
      <dc:creator>Michael</dc:creator>
      <pubDate>Wed, 01 Jun 2022 23:34:17 +0000</pubDate>
      <link>https://dev.to/marchbold/updating-an-air-project-using-apm-6m9</link>
      <guid>https://dev.to/marchbold/updating-an-air-project-using-apm-6m9</guid>
      <description>&lt;h3&gt;
  
  
  How to update an application using air packages
&lt;/h3&gt;

&lt;p&gt;In this tutorial we are going to run through how to update an application that has been setup to use the &lt;a href="https://github.com/airsdk/apm"&gt;AIR Package Manager&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This assumes you have got your AIR project running with &lt;code&gt;apm&lt;/code&gt;. If you haven’t have a look at the following tutorials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/marchbold/an-introduction-to-apm-2haf"&gt;An Introduction to APM&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/marchbold/migrating-to-the-air-package-manager-19bn"&gt;Migrating to the AIR Package Manager&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Updating a project that has been setup with apm is one of the most powerful things about the AIR Package Manager.&lt;/p&gt;

&lt;p&gt;Previously you would have had to go to the site distributing the ANE, download the ANE, check for updates to any dependencies and download them. Then you would have to check the documentation and sift through your manifest additions and info additions to check if any updates are required. This is all before you can even start to check for any code changes required. Obviously it was a painful process and one we at distriqt were all too aware of.&lt;/p&gt;

&lt;p&gt;So lets look at what we do with apm.&lt;/p&gt;

&lt;p&gt;In this example I have 2 packages installed:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My Application@1.0.0 /Users/marchbold/work/myapp
├──com.distriqt.facebook.Core@9.3.1
└──com.distriqt.IDFA@5.0.31
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Outdated Packages
&lt;/h3&gt;

&lt;p&gt;Firstly we can quickly see if there is an update available by using the outdated command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm outdated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This check the installed packages for updates in the repository:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm outdated

identifier                  installed    available
com.distriqt.facebook.Core  9.3.1        9.3.2
com.distriqt.IDFA           5.0.31       5.0.31
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;From this we can see that there is a new version of the com.distriqt.facebook.Core package available. It is a patch release (last digit in the sem ver) so will only contain bug fixes and minor updates and shouldn’t require any changes to the API (though there may be manifest changes or other such additions).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Using outdated isn’t necessary, it is just information that you can use to decide whether you want to update or not.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Update Packages
&lt;/h3&gt;

&lt;p&gt;Now that we know there is an update and we have decided to update our packages we move to the update command.&lt;/p&gt;

&lt;p&gt;Open up a terminal in the project directory, and run the help update process to print out the details on the update command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm help update

apm update

update the installed packages in your project

apm update apm       check for a new release of the apm client and update if available
apm update           update all dependencies in your project
apm update &amp;lt;foo&amp;gt;     update the &amp;lt;foo&amp;gt; dependency in your project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You will see there are several options here, the first is to update the &lt;code&gt;apm&lt;/code&gt; client (more on this later). The other commands allow you to update packages. If you pass a parameter you can specify a package to update, eg:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm update com.distriqt.IDFA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;would check to see if there are any updates to the IDFA extension and install them if available.&lt;/p&gt;

&lt;p&gt;Alternatively you can just run update without any parameters:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This process will firstly check with the repository for the latest versions of all your packages and then update them as required.&lt;/p&gt;

&lt;p&gt;Lets run this now.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You will see apm going through and checking the versions of all the extensions, uninstalling old and unused extensions, then installing the newer versions.&lt;/p&gt;

&lt;p&gt;Once complete you should be able to list your installed packages and see:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My Application@1.0.0 /Users/marchbold/work/myapp
├──com.distriqt.IDFA@5.0.31
└──com.distriqt.facebook.Core@9.3.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here we can see the facebook package is now at the updated 9.3.2 release.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finalising
&lt;/h3&gt;

&lt;p&gt;When you update (or install) a package you should always regenerate your application descriptor. This makes sure any changes to the android manifest or the ios info additions and entitlements are correctly updated in your build.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm generate app-descriptor src/MyApplication-app.xml
✓ Merge tool available
Android package name: air.com.my.app
✓ Android manifest merge
✓ iOS additions merge complete
✓ iOS entitlements merge complete
✓ App descriptor generated: /Users/marchbold/work/myapp/src/MyApplication-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now we can return to our application and check it builds and runs as expected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Updating is easy with apm, simply run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and then regenerate your application descriptor:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm generate app-descriptor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and you are done!&lt;/p&gt;

&lt;h3&gt;
  
  
  Advanced: Updating APM
&lt;/h3&gt;

&lt;p&gt;It is worth ensuring you have the latest version of apm installed. This is done through a specific form of the apm update command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm update apm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will list out the current version and then check for the latest. It will then download any updates to the apm application and install.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm: v0.0.8-beta
✓ Found new release: 0.0.9-beta
✓ Install complete
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you have the latest you will see something like the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm: v0.0.9-beta
✓ Already at latest version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Thanks for reading and if you have any questions you can reach out at the &lt;a href="https://github.com/airsdk/apm/discussions"&gt;apm discussion forum&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Migrating to the AIR Package Manager</title>
      <dc:creator>Michael</dc:creator>
      <pubDate>Wed, 01 Jun 2022 23:31:42 +0000</pubDate>
      <link>https://dev.to/marchbold/migrating-to-the-air-package-manager-19bn</link>
      <guid>https://dev.to/marchbold/migrating-to-the-air-package-manager-19bn</guid>
      <description>&lt;h3&gt;
  
  
  A case study of moving an existing project to APM
&lt;/h3&gt;

&lt;p&gt;As with most AIR developers we support clients who have been using AIR in their applications for many years. They have an existing application code base structure and build systems in place that sometimes can make integrating new systems, like the AIR Package Manager (APM), a time consuming process.&lt;/p&gt;

&lt;p&gt;In this guide we are going to run through a case study of converting one of these existing applications across to use the AIR Package Manager. Undoubtably this won’t match exactly your setup, but we wanted to show how easy it can be to migrate even a large application across to APM.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Goal&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Approach&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Process&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Summary&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;Our goal with this initial integration is to utilise APM to manage the native extensions in use with this application. We will use APM to generate the required manifest additions and info additions in the application descriptor.&lt;/p&gt;

&lt;p&gt;The application is a mobile application targeting iOS, Android and Amazon.&lt;/p&gt;

&lt;p&gt;While this is a long document the process is very simple and there are only really 5 major steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach
&lt;/h2&gt;

&lt;p&gt;The application has the following basic structure at the top level:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|____ AppLibs
|____ AppServerAPI
|____ amazon
|____ android
|____ common
|____ ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Each of the platforms has a separate directory with a common source tree and several shared libraries (AppLibs / AppServerAPI).&lt;/p&gt;

&lt;p&gt;The application descriptors are stored in each of the platform directories alongside the main application class for that platform.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|____ amazon
| |____ provisioning 
| |____ src
| | |____ assets
| | | |____ // amazon specific assets 
| | |____ App.as
| | |____ App-app.xml
|____ android
| |____ provisioning 
| |____ src
| | |____ assets
| | | |____ // android specific assets 
| | |____ App.as
| | |____ App-app.xml
|____ ios
| |____ provisioning 
| |____ src
| | |____ assets
| | | |____ // ios specific assets 
| | |____ App.as
| | |____ App-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The common directory contains the majority of the application source code along with all the ANEs for the application:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|____ common
| |____ ane
| | |____ // ANE files are here
| |____ src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;All the ANEs are stored in one location, and each application may exclude some of them from the build as there are some slight differences between the platform implementations, particularly around supported advertising mediation networks. The ANEs being stored in a single location was just to make updating the extensions simpler however with apm we don’t need to worry about this so much and instead we will have an ane directory inside each of the platform directories. We simply make a small change in our IDE to include the [platform]/ane directory in each project instead of the common/ane directory.&lt;/p&gt;

&lt;p&gt;Due to these slight differences between the platform we have decided to create a separate apm project for each platform. While this adds a slight complexity to updating (i.e. having to update multiple projects), it gives us the flexibility to control specifics of the packages used in each platform.&lt;/p&gt;

&lt;p&gt;Depending on your setup you may choose to do this as well or if you don’t have any differences between the extensions packaged on the platforms it is simpler to use one project.&lt;/p&gt;
&lt;h2&gt;
  
  
  Process
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Initialisation
&lt;/h3&gt;

&lt;p&gt;Now for some magic! We can utilise the existing application descriptor and get apm to attempt to create a project for it. To do this we pass the path to the application descriptor to the init command. We run this in the platform directory, so lets move into the android directory and do this platform first:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm init src/App-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Note we run this command in the android directory and have passed src/App-app.xml. This is so the project file is created at android/project.apm and not in the src directory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This process will read the app xml and extract the application identifier, version and other information for the project definition and importantly, it will scan the extensions, attempt to identify matching packages and add the latest version to your project.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Creating new project definition file from application descriptor: App-app.xml
✓ FOUND   : Package com.distriqt.Core@6.4.3
✓ FOUND   : Package com.distriqt.GameServices@7.2.7
✓ FOUND   : Package com.distriqt.Notifications@6.2.0
✓ FOUND   : Package com.distriqt.ZipUtils@3.0.31
✓ FOUND   : Package com.distriqt.InAppBilling@13.1.0
✓ FOUND   : Package com.distriqt.Share@7.0.12
✓ FOUND   : Package com.distriqt.Adverts@13.3.32
✓ FOUND   : Package com.distriqt.Application@6.8.1
✗ WARNING : Could not locate package for extensionID com.distriqt.Debug
✓ FOUND   : Package com.distriqt.SystemGestures@2.1.46
✓ FOUND   : Package com.distriqt.ApplicationRater@6.1.0
✓ FOUND   : Package com.distriqt.Image@5.1.79
✓ FOUND   : Package com.distriqt.MediaPlayer@4.4.8
✓ FOUND   : Package androidx.appcompat@1.2.0
✓ FOUND   : Package androidx.browser@1.3.0
✓ FOUND   : Package androidx.cardview@1.0.0
✓ FOUND   : Package androidx.core@1.3.2
✓ FOUND   : Package androidx.room@2.2.6
✓ FOUND   : Package androidx.work@2.5.0
✓ FOUND   : Package androidx.recyclerview@1.1.0
✓ FOUND   : Package androidx.multidex@2.0.1
✓ FOUND   : Package androidx.transition@1.4.0
✓ FOUND   : Package androidx.vectordrawable@1.1.0
✓ FOUND   : Package androidx.constraintlayout@1.1.3
✓ FOUND   : Package com.android.installreferrer@1.0.0
✓ FOUND   : Package com.google.android.material@1.0.0
✓ FOUND   : Package com.google.code.gson@2.8.6
✓ FOUND   : Package com.distriqt.playservices.Base@17.5.1
✓ FOUND   : Package com.distriqt.playservices.Auth@19.0.0
✓ FOUND   : Package com.distriqt.playservices.Identity@17.0.0
✓ FOUND   : Package com.distriqt.playservices.Drive@17.0.0
✓ FOUND   : Package com.distriqt.playservices.Games@21.0.0
✓ FOUND   : Package com.distriqt.playservices.Ads@20.2.0
✓ FOUND   : Package com.distriqt.playservices.AdsIdentifier@17.0.0
✓ FOUND   : Package com.distriqt.playservices.Analytics@17.0.0
✗ WARNING : Could not locate package for extensionID com.distriqt.CustomResources
✓ FOUND   : Package com.distriqt.IronSource@3.2.3
✓ FOUND   : Package com.distriqt.ironsource.AdColony@1.0.122
✓ FOUND   : Package com.distriqt.ironsource.AppLovin@1.0.117
✗ WARNING : Could not locate package for extensionID com.amazon.extensions.GameCircle
Processing identified packages
✗ SKIPPING : Dependency: com.distriqt.Core@6.4.3
✓ ADDING   : Package: com.distriqt.GameServices@7.2.7
✓ ADDING   : Package: com.distriqt.Notifications@6.2.0
✓ ADDING   : Package: com.distriqt.ZipUtils@3.0.31
✓ ADDING   : Package: com.distriqt.InAppBilling@13.1.0
✓ ADDING   : Package: com.distriqt.Share@7.0.12
✓ ADDING   : Package: com.distriqt.Adverts@13.3.32
✓ ADDING   : Package: com.distriqt.Application@6.8.1
✓ ADDING   : Package: com.distriqt.SystemGestures@2.1.46
✓ ADDING   : Package: com.distriqt.ApplicationRater@6.1.0
✓ ADDING   : Package: com.distriqt.Image@5.1.79
✓ ADDING   : Package: com.distriqt.MediaPlayer@4.4.8
✗ SKIPPING : Dependency: androidx.appcompat@1.2.0
✗ SKIPPING : Dependency: androidx.browser@1.3.0
✗ SKIPPING : Dependency: androidx.cardview@1.0.0
✗ SKIPPING : Dependency: androidx.core@1.3.2
✗ SKIPPING : Dependency: androidx.room@2.2.6
✗ SKIPPING : Dependency: androidx.work@2.5.0
✗ SKIPPING : Dependency: androidx.recyclerview@1.1.0
✗ SKIPPING : Dependency: androidx.multidex@2.0.1
✗ SKIPPING : Dependency: androidx.transition@1.4.0
✗ SKIPPING : Dependency: androidx.vectordrawable@1.1.0
✗ SKIPPING : Dependency: androidx.constraintlayout@1.1.3
✓ ADDING   : Package: com.android.installreferrer@1.0.0
✗ SKIPPING : Dependency: com.google.android.material@1.0.0
✗ SKIPPING : Dependency: com.google.code.gson@2.8.6
✗ SKIPPING : Dependency: com.distriqt.playservices.Base@17.5.1
✗ SKIPPING : Dependency: com.distriqt.playservices.Auth@19.0.0
✗ SKIPPING : Dependency: com.distriqt.playservices.Identity@17.0.0
✗ SKIPPING : Dependency: com.distriqt.playservices.Drive@17.0.0
✗ SKIPPING : Dependency: com.distriqt.playservices.Games@21.0.0
✗ SKIPPING : Dependency: com.distriqt.playservices.Ads@20.2.0
✗ SKIPPING : Dependency: com.distriqt.playservices.AdsIdentifier@17.0.0
✗ SKIPPING : Dependency: com.distriqt.playservices.Analytics@17.0.0
✗ SKIPPING : Dependency: com.distriqt.IronSource@3.2.3
✓ ADDING   : Package: com.distriqt.ironsource.AdColony@1.0.122
✓ ADDING   : Package: com.distriqt.ironsource.AppLovin@1.0.117
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This application is a decent size so contains a number of extensions and dependencies.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You will note there are a couple of WARNING flags in there for extensions that it couldn’t find: com.distriqt.CustomResources , com.distriqt.Debug and com.amazon.extensions.GameCircle.&lt;br&gt;
 We will address these later in the section “Manually Add Extensions”.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The process has gone through and identified all the extensions and we can check with apm list:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm list 
App[@3](http://twitter.com/3).3.7 ~/work/application/android
├──com.distriqt.GameServices@7.2.7
├──com.distriqt.Notifications@6.2.0
├──com.distriqt.ZipUtils@3.0.31
├──com.distriqt.InAppBilling@13.1.0
├──com.distriqt.Share@7.0.12
├──com.distriqt.Adverts@13.3.32
├──com.distriqt.Application@6.8.1
├──com.distriqt.SystemGestures@2.1.46
├──com.distriqt.ApplicationRater@6.1.0
├──com.distriqt.Image@5.1.79
├──com.distriqt.MediaPlayer@4.4.8
├──com.android.installreferrer@1.0.0
├──com.distriqt.ironsource.AdColony@1.0.122
└──com.distriqt.ironsource.AppLovin@1.0.117
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The process skips all packages that are dependencies of another package. So this doesn’t add things like the playservices and androidx libs, but unfortunately it has incorrectly skipped com.distriqt.IronSource . This won’t affect anything as we have the mediators there for IronSource which will trigger the main extension installation but it is convenient to list it separately incase we remove the mediators later. So we will manually install this package later. We do hope to improve this, but currently it’s just something to watch out for.&lt;/p&gt;
&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Next we will trigger an install.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This will download all the latest versions of the extensions and deploy them to the ane directory in our platform directory.&lt;/p&gt;

&lt;p&gt;Once complete we will have&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|____ android
| |____ ane
| |____ apm_packages
| |____ project.apm
| |____ provisioning
| |____ src
| | |____ assets
| | | |____ // android specific assets 
| | |____ App.as
| | |____ App-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The ane directory contains all the downloaded extensions and the apm_packages directory is a cache directory used by apm . You can add this directory to your .gitignore (or equivalent), but do not delete it. apm will use this cache for certain operations and would need to download the package again if you delete it.&lt;/p&gt;

&lt;p&gt;At this point lets add that incorrectly skipped ironSource package:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm install com.distriqt.IronSource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;p&gt;Next we check the configuration to make sure we have correctly set any configuration items for the packages. We list the configuration parameters required by running apm project config :&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm project config

photoLibraryAddUsageDescription=Access to photo library is required to save images.
motionUsageDescription=
calendarsUsageDescription=
photoLibraryUsageDescription=Access to photo library is required to save images.
adMobIOSApplicationId=
adMobAndroidApplicationId=
playGamesAppId=XXXXXXXX
cameraUsageDescription=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;There are several important pieces of information here, such as the AdMob application identifiers and the Play Games App Id. All these values would have been in your application descriptor previously but we need to inform apm of these values. To set a value:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm project config set [NAME] [VALUE]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;eg:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm project config set adMobAndroidApplicationId ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Make sure you set values for all of the configuration:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adMobAndroidApplicationId=ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY
adMobIOSApplicationId=ca-app-pub-XXXXXXXXXXXXXXXX~ZZZZZZZZZZ
calendarsUsageDescription=Calendar usage description
cameraUsageDescription=Camera usage description
motionUsageDescription=Motion usage description
photoLibraryAddUsageDescription=Access to photo library is required to save images.
photoLibraryUsageDescription=Access to photo library is required to save images.
playGamesAppId=TTTTTTTTTTTT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Manually Add Extensions
&lt;/h3&gt;

&lt;p&gt;Now we can address those extensions that aren’t packages and need to be handled manually. Firstly just copy these extensions the the android/ane directory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;apm will remove extensions from this location but only ones that are unused dependencies or directly uninstalled, so these extensions will never be affected by apm.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two of the extensions, com.distriqt.CustomResources and com.distriqt.Debug are simple extensions that don’t require any manifest additions so once we have copied them across we are done with them.&lt;/p&gt;

&lt;p&gt;However com.amazon.extensions.GameCircle has some manifest additions. In order to add manifest entries with apm we create a new xml file at &lt;strong&gt;config/android/AndroidManifest.xml&lt;/strong&gt; . This file is used to specify any additional manifest entries you require for your application. This file should have the following contents:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;manifest 
  xmlns:android="http://schemas.android.com/apk/res/android" &amp;gt;

    &amp;lt;uses-sdk 
        android:minSdkVersion="19" 
        android:targetSdkVersion="30" /&amp;gt;


&amp;lt;/manifest&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;I immediately place the uses-sdk tag in here to make sure we are specifying the correct minimum and target SDK for android. &lt;em&gt;This is a good file to create even if you don’t have any other manifest additions, just to make sure you specify these SDK versions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now add the additions for the GameCircle ANE:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
These will now be merged with the other extensions manifest additions automatically.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One thing to note here is the usage of the application package name in the manifest additions (air.application.id). You can leave that as is without any issues, however if you replace it with ${applicationId} then the merge process will insert it automatically for you and will make it easier for you to copy these additions into another project.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So now we have:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|____ android
| |____ ane
| |____ apm_packages
| |____ config
| | |____ android
| | | |____ AndroidManifest.xml
| |____ project.apm
| |____ provisioning
| |____ src
| | |____ assets
| | | |____ // android specific assets 
| | |____ App.as
| | |____ App-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If this was an iOS application with info additions we would have added &lt;strong&gt;config/ios/InfoAdditions.xml&lt;/strong&gt; with the following content (the usage description string is just an example):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;plist version="1.0"&amp;gt;
  &amp;lt;dict&amp;gt;

    &amp;lt;key&amp;gt;NSPhotoLibraryAddUsageDescription&amp;lt;/key&amp;gt;
    &amp;lt;string&amp;gt;Some description string.&amp;lt;/string&amp;gt;

  &amp;lt;/dict&amp;gt;
&amp;lt;/plist&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Generate Application Descriptor
&lt;/h3&gt;

&lt;p&gt;Now we have actually completed the conversion to apm for the android project! We can use apm to generate the application descriptor. This is important to do now as during the above process you will likely have updated the extensions to their latest versions which may have had manifest changes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before we do this, if you aren’t using version control, make a backup of your existing application descriptor. This process will modify it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To generate the app descriptor we call apm generate app-descriptor and pass the location of the current application descriptor:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apm generate app-descriptor src/App-app.xml
Merging with supplied main manifest: config/android/AndroidManifest.xml
Android package name: air.application.id
✓ Android manifest merge
✓ iOS additions merge complete
✓ iOS entitlements merge complete
✓ App descriptor generated: /XXX/android/src/App-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;At this point we open up our IDE and check that the application launches and runs as expected. The only change we have made to the build configuration is the relocation of the ane directory.&lt;/p&gt;

&lt;p&gt;We then repeat this process with the other platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this case study we have shown how to migrate an existing project to apm.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Initialise using your existing application descriptor:&lt;/p&gt;

&lt;p&gt;$ apm init src/App-app.xml&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the packages:&lt;/p&gt;

&lt;p&gt;$ apm install&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set configuration parameters&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Handle any extensions that couldn’t be located as manually add extensions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate your application descriptor&lt;/p&gt;

&lt;p&gt;$ apm generate app-descriptor src/App-app.xml&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You now have an active apm managed project that you can use to simply add and &lt;strong&gt;update&lt;/strong&gt; packages and most importantly, &lt;strong&gt;never again struggle with manifest additions!&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Thanks for reading and if you have any questions you can reach out at the &lt;a href="https://github.com/airsdk/apm/discussions"&gt;apm discussion forum&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>apm</category>
      <category>airsdk</category>
      <category>library</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>An Introduction to APM</title>
      <dc:creator>Michael</dc:creator>
      <pubDate>Wed, 01 Jun 2022 23:27:31 +0000</pubDate>
      <link>https://dev.to/marchbold/an-introduction-to-apm-2haf</link>
      <guid>https://dev.to/marchbold/an-introduction-to-apm-2haf</guid>
      <description>&lt;p&gt;APM is the AIR Package Manager which allows management of AIR libraries and extensions and assists in creation of the application descriptor.&lt;/p&gt;

&lt;p&gt;The initial goal of APM is simplify the setup and updating of an AIR application, in particular mobile applications, where the environment and SDKs (extensions) change rapidly.&lt;/p&gt;

&lt;p&gt;Here I will show you how to create a new AIR application and use apm to add a dependency.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Installation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install a Package&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add to your IDE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check Configuration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generate the Application Descriptor&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get Coding&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Installation is a manual process at the moment and is still a work in progress. To install firstly download the latest release from the &lt;a href="https://github.com/airsdk/apm/releases"&gt;apm releases&lt;/a&gt; and then follow the guide to &lt;a href="https://github.com/airsdk/apm/wiki/Installation#environment-setup"&gt;setup your environment&lt;/a&gt; correctly. Basically the goal is to ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;extracted the release to a location;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;made the location available in your PATH;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You need to ensure you have at least AIR SDK v33.1.1.554 installed.&lt;/p&gt;

&lt;p&gt;Once installed you should be able to open a terminal and enter:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm -version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This will output the version of the tool.&lt;/p&gt;
&lt;h2&gt;
  
  
  Create a Project
&lt;/h2&gt;

&lt;p&gt;Firstly, let’s create a directory for our project, you can create a new empty directory or you can use a new project directory created through an IDE. The key is to open a terminal at the location where you would normally place a src directory containing all your actionscript source code.&lt;/p&gt;

&lt;p&gt;Let’s initialise a new project by running apm init. This will run through some basic questions to setup the project configuration:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ apm init
Creating new project definition file
Application Identifier [com.my.app]: com.example.app
Application Name [My Application]: Example App
Application Version [1.0.0]: 1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Your directory will now contain a project.apm file. This is the file that contains all the information about your project including installed packages, versions and configuration values. You shouldn't need to edit this file directly but feel free to have a look at the contents (it is a json formatted text file).&lt;/p&gt;
&lt;h2&gt;
  
  
  Install a Package
&lt;/h2&gt;

&lt;p&gt;Next let’s search for a package to install. We will look for an “IDFA” extension to be able to get an advertising identifier for a user. Searching is done by calling apm search [query] so:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm search IDFA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This will run as below and finds the com.distriqt.IDFA extension:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; apm search IDFA
✓ Search complete
found [1] matching package(s) for search 'IDFA'
└──com.distriqt.IDFA@5.0.31   The IDFA extension gives you simple access to the advertising identifiers on Android and iOS.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Let’s go ahead and install this extension:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm install com.distriqt.IDFA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This will get the details of the extension, and dependencies and install all the required extensions:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ apm install com.distriqt.IDFA
com.distriqt.IDFA@5.0.31
androidx.core@1.3.2
com.distriqt.playservices.AdsIdentifier@17.0.0
com.distriqt.playservices.Base@17.5.1
com.distriqt.Core@6.4.3
Installing package : com.distriqt.IDFA@5.0.31
✓ downloaded
✓ extracted
Installed package : com.distriqt.IDFA@5.0.31
Installing package : com.distriqt.playservices.Base@17.5.1
✓ downloaded
✓ extracted
Installed package : com.distriqt.playservices.Base@17.5.1
Installing package : com.distriqt.playservices.AdsIdentifier@17.0.0
✓ downloaded
✓ extracted
Installed package : com.distriqt.playservices.AdsIdentifier@17.0.0
Installing package : com.distriqt.Core@6.4.3
✓ downloaded
✓ extracted
Installed package : com.distriqt.Core@6.4.3
Installing package : androidx.core@1.3.2
✓ downloaded
✓ extracted
Installed package : androidx.core@1.3.2
✓ Deployed: com.distriqt.IDFA@5.0.31
✓ Deployed: com.distriqt.playservices.Base@17.5.1
✓ Deployed: com.distriqt.playservices.AdsIdentifier@17.0.0
✓ Deployed: com.distriqt.Core@6.4.3
✓ Deployed: androidx.core@1.3.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;You can see this extension has 4 dependencies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;com.distriqt.playservices.Base&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;com.distriqt.playservices.AdsIdentifier&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;com.distriqt.Core&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;androidx.core&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these is downloaded and installed along with the main com.distriqt.IDFA extension. Once complete you will have the following directory structure created:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|____apm_packages
|____ane
| |____androidx.core.ane
| |____com.distriqt.Core.ane
| |____com.distriqt.IDFA.ane
| |____com.distriqt.playservices.AdsIdentifier.ane
| |____com.distriqt.playservices.Base.ane
|____project.apm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The apm_packages directory is a cache directory, where apm keeps all your installed packages and details on them. The contents of this directory are used for apm operations so don't modify the contents of this directory. It is completely recreatable though by running apm install so you can add it to your .gitignore (or similar version control system) and just run apm install when starting development. Feel free to try that now, i.e. delete the apm_packages directory and run apm install. You should see something similar to the original install command output and the cache recreated.&lt;/p&gt;
&lt;h2&gt;
  
  
  Add to your IDE
&lt;/h2&gt;

&lt;p&gt;Next let’s open up your IDE and add the outputs from apm to your IDE.&lt;/p&gt;

&lt;p&gt;In this case we have an ane directory containing the extensions. For example, in IntelliJ I would open up the module settings and add the ane directory as a dependency:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E7FSveZT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AO_EjxDglap9QrvT_AN-1PA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E7FSveZT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AO_EjxDglap9QrvT_AN-1PA.png" alt="" width="880" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If you had installed a package with a SWC then you would also have a libs directory containing the swc files, and if you installed a package with source code then you may have a libs_src directory containing the package source code.&lt;/em&gt;&lt;br&gt;
 &lt;em&gt;Similarly you should add these two directories to your build if they are present.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Check Configuration
&lt;/h2&gt;

&lt;p&gt;Next you should check the project configuration to check if you want to make any changes to the configuration parameters that will be used for the extensions.&lt;/p&gt;

&lt;p&gt;To do this run apm project config which will output all the current configuration parameters for your project:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; apm project config
userTrackingUsageDescription=Allows us to deliver personalized ads for you.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;You will see there is one configuration parameter for the IDFA extension, which is the usage description that is used in the App Tracking Transparency dialog on iOS. If you wish to update it use the config set command: apm project config set  &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; apm project config set userTrackingUsageDescription "Better advertising for you."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Check it updated correctly by using:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ apm project config
userTrackingUsageDescription=Better advertising for you.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Generate the Application Descriptor
&lt;/h2&gt;

&lt;p&gt;The next step which is particularly important for extensions, is to generate the application descriptor by calling apm generate app-descriptor. This will create an application descriptor with all the correct manifest additions, info additions and extensions for you to build your application.&lt;/p&gt;

&lt;p&gt;The default is output to src/APPNAME-app.xml.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: If you already have an application descriptor at src/APPNAME-app.xml then it will be used as a template. The id, version, manifestAdditions, InfoAdditions, and Entitlements sections will be overwritten and the extensions will be corrected to ensure the required extensions are added.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ apm generate app-descriptor
Android package name: air.com.example.app
✓ Android manifest merge
✓ iOS additions merge complete
✓ iOS entitlements merge complete
✓ App descriptor generated: /Users/marchbold/exampleapp/src/ExampleApp-app.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Your application package name will be correctly inserted into appropriate spots, all permissions and manifest entries will be inserted and merged correctly and configuration parameters applied.&lt;/p&gt;

&lt;p&gt;This creates the following:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  Get Coding
&lt;/h2&gt;

&lt;p&gt;Now it is time to start writing code. You will see all the work of reading documentation and downloading the correct dependencies and adding manifest additions has been reduced to two commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apm install com.distriqt.IDFA
apm generate app-descriptor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Open up your IDE and start coding, (you may now have to refer to the documentation for usage of the package though :) )&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



</description>
      <category>extensions</category>
      <category>airsdk</category>
      <category>library</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
