|
| 1 | +--- |
| 2 | +title: Migrating to v18.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 | +The Android implementation has been updated to v17.0.1 and the iOS implementation has been updated to v18.0.0. |
| 12 | +This should bring a range of bug fixes and improvements however the implementation remains largely unchanged. |
| 13 | +The main change is around the integration of the extension into your application as we have moved to using gradle dependencies within our extensions. |
| 14 | + |
| 15 | + |
| 16 | +## Android Integration |
| 17 | + |
| 18 | +### Gradle Dependencies |
| 19 | + |
| 20 | +We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions. |
| 21 | + |
| 22 | +This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest in your application descriptor. |
| 23 | + |
| 24 | +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: |
| 25 | + |
| 26 | +```bash |
| 27 | +apm update |
| 28 | +apm generate app-descriptor |
| 29 | +``` |
| 30 | + |
| 31 | +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. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +### Updating code |
| 36 | + |
| 37 | +There should be no changes to your code required for this update. |
| 38 | + |
| 39 | + |
| 40 | +### Updating the manifest |
| 41 | + |
| 42 | +You can simplify the manifest now as well as the gradle implementation will add a significant amount of the required manifest entries for you. |
| 43 | +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. |
| 44 | + |
| 45 | +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. You no longer have to manually add all of the Facebook related manifest entries as these are now added automatically by the gradle implementation. |
| 46 | + |
| 47 | +There are still some meta-data entries that you may need to add for specific features, but these are minimal. |
| 48 | + |
| 49 | +Below are the minimum manifest additions required for each of the extensions. |
| 50 | + |
| 51 | +:::caution |
| 52 | +Ensure you replace: |
| 53 | +- `APPLICATION_PACKAGE` with your AIR application's Java package name, something like `air.com.distriqt.test`. Generally this is your AIR application id prefixed by `air.` unless you have specified no air flair in your build options. |
| 54 | +- You will need to replace the instances of `FACEBOOK_APP_ID`, `FACEBOOK_APP_NAME` and `FACEBOOK_CLIENT_TOKEN` with the relevant settings from your Facebook app. See [Get Started](../../get-started.md) for details. |
| 55 | +- Ensure the `\u003` remains in front of the app id and client token (this ensures the value is treated as a string correctly). |
| 56 | +::: |
| 57 | + |
| 58 | + |
| 59 | +#### Core and Login |
| 60 | + |
| 61 | +```xml |
| 62 | +<manifest android:installLocation="auto"> |
| 63 | + |
| 64 | + <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/> |
| 65 | + |
| 66 | + <uses-permission android:name="android.permission.INTERNET"/> |
| 67 | + |
| 68 | + <application> |
| 69 | + |
| 70 | + <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\u003FACEBOOK_APP_ID"/> |
| 71 | + <meta-data android:name="com.facebook.sdk.ClientToken" android:value="\u003FACEBOOK_CLIENT_TOKEN"/> |
| 72 | + |
| 73 | + <!-- Optional meta-data configuration --> |
| 74 | + <!-- <meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="false"/> --> |
| 75 | + <!-- <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/> --> |
| 76 | + <!-- <meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/> --> |
| 77 | + |
| 78 | +</manifest> |
| 79 | +``` |
| 80 | + |
| 81 | +#### Share and Gaming |
| 82 | + |
| 83 | +```xml |
| 84 | +<manifest android:installLocation="auto"> |
| 85 | + |
| 86 | + <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/> |
| 87 | + |
| 88 | + <uses-permission android:name="android.permission.INTERNET"/> |
| 89 | + |
| 90 | + <queries> |
| 91 | + <provider android:authorities="com.facebook.katana.provider.PlatformProvider" /> <!-- allows app to access Facebook app features --> |
| 92 | + <provider android:authorities="com.facebook.orca.provider.PlatformProvider" /> <!-- allows sharing to Messenger app --> |
| 93 | + </queries> |
| 94 | + |
| 95 | + <application> |
| 96 | + |
| 97 | + <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\u003FACEBOOK_APP_ID"/> |
| 98 | + <meta-data android:name="com.facebook.sdk.ClientToken" android:value="\u003FACEBOOK_CLIENT_TOKEN"/> |
| 99 | + |
| 100 | + <!-- Optional meta-data configuration --> |
| 101 | + <!-- <meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="false"/> --> |
| 102 | + <!-- <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/> --> |
| 103 | + <!-- <meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/> --> |
| 104 | + |
| 105 | + <!-- Share --> |
| 106 | + <provider android:authorities="com.facebook.app.FacebookContentProviderFACEBOOK_APP_ID" |
| 107 | + android:name="com.facebook.FacebookContentProvider" |
| 108 | + android:exported="true"/> |
| 109 | + |
| 110 | +</manifest> |
| 111 | +``` |
| 112 | + |
| 113 | + |
| 114 | + |
0 commit comments