|
| 1 | +--- |
| 2 | +title: Migrating |
| 3 | +sidebar_label: Migrating |
| 4 | +--- |
| 5 | + |
| 6 | +import Tabs from '@theme/Tabs' |
| 7 | +import TabItem from '@theme/TabItem' |
| 8 | + |
| 9 | + |
| 10 | +## Version 6.0 |
| 11 | + |
| 12 | +This latest release brings a number of updates to the extension particularly around android integration. |
| 13 | + |
| 14 | +We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions. |
| 15 | +This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest (though we still highly recommend using apm for this purpose). |
| 16 | + |
| 17 | +There should be no changes required to your code for this update. |
| 18 | + |
| 19 | +However we do suggest checking out the manifest additions for the latest version of the extension as you should be able to greatly simplify your application descriptor now. |
| 20 | + |
| 21 | + |
| 22 | +### Android Integration |
| 23 | + |
| 24 | +#### Gradle Dependencies |
| 25 | + |
| 26 | +We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions. |
| 27 | + |
| 28 | +This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest in your application descriptor. |
| 29 | + |
| 30 | + |
| 31 | +#### Updating code |
| 32 | + |
| 33 | +There should be no changes required to your code for this update. |
| 34 | + |
| 35 | + |
| 36 | +#### Updating the manifest |
| 37 | + |
| 38 | +You can simplify the manifest now as well as the gradle implementation will add a significant amount of the required manifest entries for you. |
| 39 | +If you use the `apm` tool to generate your application descriptor |
| 40 | + |
| 41 | +We highly recommend using the [apm](https://airnativeextensions.com/docs/using-apm) tool to manage the integration of the extensions in your application and to generate your application descriptor: |
| 42 | + |
| 43 | +```bash |
| 44 | +apm generate app-descriptor |
| 45 | +``` |
| 46 | + |
| 47 | +You will see the manifest entries are significantly reduced and simply running the commands above will update the manifest for you. |
| 48 | + |
| 49 | +However, you can still integrate the manifest additions manually if you prefer. With this update we recommend starting fresh as there have been a lot of entries to be removed. |
| 50 | + |
| 51 | +If you manually update the manifest then, we recommend starting fresh as there have been a lot of entries to be removed. |
| 52 | +The minimum manifest additions now looks like the following: |
| 53 | + |
| 54 | +```xml |
| 55 | +<manifest android:installLocation="auto"> |
| 56 | + |
| 57 | + <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/> |
| 58 | + |
| 59 | + <uses-permission android:name="android.permission.INTERNET"/> |
| 60 | + |
| 61 | + <application> |
| 62 | + |
| 63 | + <activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> |
| 64 | + |
| 65 | + </application> |
| 66 | + |
| 67 | +</manifest> |
| 68 | +``` |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +## Version 5 |
| 73 | + |
| 74 | +Version 5 brings the iOS 14 authorisation requests using the App Tracking Transparency framework. |
| 75 | + |
| 76 | +You will need to add the usage description to your info additions: |
| 77 | + |
| 78 | +```xml |
| 79 | +<key>NSUserTrackingUsageDescription</key> |
| 80 | +<string>This identifier will be used to deliver personalized ads to you.</string> |
| 81 | +``` |
| 82 | + |
| 83 | +([Reference](add-the-extension.mdx)) |
| 84 | + |
| 85 | +And to ensure you have authorisation before attempting to retrieve the IDFA: |
| 86 | + |
| 87 | +```actionscript |
| 88 | +if (IDFA.service.authorisationStatus() == TrackingAuthorisationStatus.AUTHORISED) |
| 89 | +{ |
| 90 | + // You have permission to access the IDFA |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +[Reference](get-advertising-identifier.md#authorisation) |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | +## Version 4 |
| 99 | + |
| 100 | +Version 4 changes the Google Play Services dependencies removing the dependency on the entire Ads library and replacing it with the much smaller AdsIdentifier library. |
| 101 | + |
| 102 | +In order to support this change you will need to add the `com.distriqt.playservices.AdsIdentifier` dependency and remove the `com.distriqt.playservices.Ads`. |
| 103 | + |
| 104 | +Please note that other extensions may still need the `com.distriqt.playservices.Ads` extension (mainly AdMob or related services) so ensure you check your other ANEs before removing it. |
| 105 | + |
0 commit comments