|
| 1 | +--- |
| 2 | +title: Migrating to version 1.0 |
| 3 | +--- |
| 4 | + |
| 5 | +import Tabs from '@theme/Tabs' |
| 6 | +import TabItem from '@theme/TabItem' |
| 7 | + |
| 8 | + |
| 9 | +This latest release brings a number of updates to the extension particularly around the Android integration. |
| 10 | + |
| 11 | +Most importantly the underlying Braze SDK has been updated to the latest releases: |
| 12 | +- Android: v36.0.0 |
| 13 | +- iOS: v12.0.0 |
| 14 | + |
| 15 | +The implementation remains largely the same however there are some changes to the integration of the extension that you should be aware of. |
| 16 | + |
| 17 | +Additionally make sure you update all dependency extensions to the latest versions as well, `apm` will help you with this. |
| 18 | + |
| 19 | + |
| 20 | +## Updating code |
| 21 | + |
| 22 | +You should update your code to use the `ImageOnlyCard` instead of the `BannerImageCard`. This change was made to better align with the Braze SDK. |
| 23 | + |
| 24 | +This should be a simple change in your code, for example: |
| 25 | + |
| 26 | +```actionscript |
| 27 | +import com.distriqt.extension.braze.contentcards.ImageOnlyCard; |
| 28 | +``` |
| 29 | + |
| 30 | +should now be used to import the `ImageOnlyCard` class, instead of the previous import for `BannerImageCard`: |
| 31 | + |
| 32 | +```actionscript |
| 33 | +import com.distriqt.extension.braze.contentcards.BannerImageCard; |
| 34 | +``` |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +## Android Integration |
| 40 | + |
| 41 | +### Minimum SDK Version |
| 42 | + |
| 43 | +The minimum SDK version has been updated to 25 (Android 7.1 Nougat) and the target SDK version has been updated to 34 (Android 14). |
| 44 | + |
| 45 | +### Gradle Version |
| 46 | + |
| 47 | +We have updated the required gradle version used to build your application to be higher than the default AIR currently uses. |
| 48 | + |
| 49 | +To specify a higher version add the following to your android node in your application descriptor: |
| 50 | + |
| 51 | +```xml |
| 52 | +<android> |
| 53 | + <gradleVersion>8.9</gradleVersion> |
| 54 | + <androidGradlePluginVersion>8.7.3</androidGradlePluginVersion> |
| 55 | + |
| 56 | + ... |
| 57 | +</android> |
| 58 | +``` |
| 59 | + |
| 60 | +If you don't do this you will see the following error when building your application: |
| 61 | + |
| 62 | +``` |
| 63 | +Unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed: |
| 64 | +FAILURE: Build failed with an exception. |
| 65 | +
|
| 66 | +... |
| 67 | +
|
| 68 | + > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 |
| 69 | +``` |
| 70 | + |
| 71 | +:::note |
| 72 | +May 2025: This is not currently automatically handled by `apm` so you will need to add this manually to your application descriptor. |
| 73 | + |
| 74 | +We are working on an update to handle this. |
| 75 | +::: |
| 76 | + |
| 77 | + |
| 78 | +### Gradle Dependencies |
| 79 | + |
| 80 | +We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions. |
| 81 | + |
| 82 | +This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest in your application descriptor. |
| 83 | + |
| 84 | +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: |
| 85 | + |
| 86 | +```bash |
| 87 | +apm update |
| 88 | +apm generate app-descriptor |
| 89 | +``` |
| 90 | + |
| 91 | +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. |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +### Updating the manifest |
| 96 | + |
| 97 | +You can simplify the manifest now as well as the gradle implementation will add a significant amount of the required manifest entries for you. |
| 98 | +If you use the `apm` tool to generate your application descriptor you will see the manifest entries are significantly reduced and simply running the commands above will update the manifest for you. |
| 99 | + |
| 100 | +If you manually update the manifest then, as mentioned above, we recommend starting fresh as there have been a lot of entries to be removed. |
| 101 | +The minimum manifest additions now looks like the following: |
| 102 | + |
| 103 | +```xml |
| 104 | +<manifest android:installLocation="auto" > |
| 105 | + <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="34" /> |
| 106 | + <uses-permission android:name="android.permission.INTERNET" /> |
| 107 | + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 108 | + <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
| 109 | + <application> |
| 110 | + <meta-data android:name="android.max_aspect" android:value="2.5" /> |
| 111 | + <meta-data android:name="android.notch_support" android:value="true"/> |
| 112 | + <activity android:name="com.distriqt.extension.braze.contentcards.BrazeContentCardsActivity" android:exported="false" android:theme="@style/Theme.AppCompat.NoActionBar"/> |
| 113 | + <service android:name="com.braze.push.BrazeFirebaseMessagingService" android:exported="false"> |
| 114 | + <intent-filter> |
| 115 | + <action android:name="com.google.firebase.MESSAGING_EVENT" /> |
| 116 | + </intent-filter> |
| 117 | + </service> |
| 118 | + <activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> |
| 119 | + </application> |
| 120 | +</manifest> |
| 121 | +``` |
| 122 | + |
| 123 | +You no longer have to manually add all of the braze, and androidx related manifest entries as these are now added automatically by the gradle implementation. |
| 124 | + |
| 125 | + |
| 126 | +### Assets |
| 127 | + |
| 128 | +You used to have to manually add the following files to your application, however these are now automatically added by the gradle implementation: |
| 129 | + |
| 130 | +``` |
| 131 | +braze-html-in-app-message-bridge.js |
| 132 | +fontawesome-webfont.ttf |
| 133 | +``` |
| 134 | + |
| 135 | +You should remove these files from your application and let the gradle implementation add them for you. |
| 136 | +**If you are using `apm` you may find there is no longer an `assets/android` directory so you should remove this from your package.** (This may still exist if you have other airpackages that require android assets). |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +## iOS Integration |
| 141 | + |
| 142 | + |
| 143 | +### Minimum SDK Version |
| 144 | + |
| 145 | +The minimum SDK version has been updated to 13. |
| 146 | + |
| 147 | +If you are manaully managing the minimum version, check your info additions for the following: |
| 148 | + |
| 149 | +```xml |
| 150 | +<key>MinimumOSVersion</key> |
| 151 | +<string>13.0</string> |
| 152 | +``` |
| 153 | + |
| 154 | + |
0 commit comments