|
| 1 | +--- |
| 2 | +title: Migrating to v7.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 | +It also brings a complete rewrite of the Android implementation to use the latest Google credential and authorisiation libriaries. |
| 12 | + |
| 13 | +The iOS implementation has been updated to v8.0.0 however the implementation remains largely unchanged. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +## Android Integration |
| 19 | + |
| 20 | +### Gradle Dependencies |
| 21 | + |
| 22 | +We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions. |
| 23 | + |
| 24 | +This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest in your application descriptor. |
| 25 | + |
| 26 | +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: |
| 27 | + |
| 28 | +```bash |
| 29 | +apm update |
| 30 | +apm generate app-descriptor |
| 31 | +``` |
| 32 | + |
| 33 | +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. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +### Updating code |
| 38 | + |
| 39 | +The main changes required to update your code are around the setup of the extension. |
| 40 | +You are now required to supply the web client ID to sign in with Google on Android so you must ensure you call `setAndroidServerClientID()` with your web client id: |
| 41 | + |
| 42 | +```actionscript |
| 43 | +var options:GoogleIdentityOptions = new GoogleIdentityOptionsBuilder() |
| 44 | + .requestEmail() |
| 45 | + .setIOSClientID( IOS_CLIENT_ID ) |
| 46 | +
|
| 47 | + // Add the web client id for android |
| 48 | + .setAndroidServerClientID( WEB_CLIENT_ID ) |
| 49 | + |
| 50 | + .build(); |
| 51 | +
|
| 52 | +GoogleIdentity.service.setup( options ); |
| 53 | +``` |
| 54 | + |
| 55 | + |
| 56 | +### Updating the manifest |
| 57 | + |
| 58 | +You can simplify the manifest now as well as the gradle implementation will add a significant amount of the required manifest entries for you. |
| 59 | +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. |
| 60 | + |
| 61 | +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. |
| 62 | +The minimum manifest additions now looks like the following: |
| 63 | + |
| 64 | +```xml |
| 65 | +<manifest android:installLocation="auto"> |
| 66 | + |
| 67 | + <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/> |
| 68 | + |
| 69 | + <uses-permission android:name="android.permission.INTERNET"/> |
| 70 | + |
| 71 | + <application> |
| 72 | + |
| 73 | + <activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> |
| 74 | + |
| 75 | + </application> |
| 76 | + |
| 77 | +</manifest> |
| 78 | +``` |
| 79 | + |
0 commit comments