Skip to content

Commit cd1e846

Browse files
committed
agerange v0.0.1
1 parent e813777 commit cd1e846

20 files changed

+847
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
3+
Updating your application descriptor will insert the required `extensionID`'s and generate the manifest and info additions for your application.
4+
5+
You update your application descriptor by running:
6+
7+
```
8+
apm generate app-descriptor src/MyApp-app.xml
9+
```
10+
11+
Change the path (`src/MyApp-app.xml`) to point to your application descriptor.
12+
13+
:::caution
14+
This will modify your application descriptor replacing the manifest additions and info additions with the ones generated from `apm`.
15+
16+
You should backup your application descriptor before running this command to ensure you don't lose any information.
17+
18+
If you need to insert custom data into these sections see the guides for [Android](https://github.com/airsdk/apm/wiki/Usage-Generate#android) and [iOS](https://github.com/airsdk/apm/wiki/Usage-Generate#ios)
19+
:::
20+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
3+
4+
:::info
5+
Note: All of the commands below should be run in a terminal / command prompt in the root directory of your application, generally the level above your source directory.
6+
:::
7+
8+
import SetupAPM from '../../_includes/apm/setup-apm.mdx'
9+
10+
<SetupAPM />
11+
12+
13+
### Install the extension
14+
15+
Install the extension by running:
16+
17+
```
18+
apm install com.distriqt.AgeRange
19+
```
20+
21+
This will download and install the extension, required assets, and all dependencies.
22+
23+
Once complete `apm` will have created something like the following file structure:
24+
25+
```
26+
.
27+
|____ ane
28+
| |____ com.distriqt.AgeRange.ane # AgeRange extension
29+
| |____ [dependencies]
30+
|____ apm_packages # cache directory - ignore
31+
|____ project.apm # apm project file
32+
```
33+
34+
- Add the `ane` directory to your IDE. *See the tutorials located [here](/docs/tutorials/getting-started) on adding an extension to your IDE.*
35+
36+
37+
:::info
38+
We suggest you use the locations directly in your builds rather than copying the files elsewhere. The reason for this is if you ever go to update the extensions using `apm` that these updates will be pulled into your build automatically.
39+
:::
40+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
## Extension IDs
3+
4+
The following should be added to your `extensions` node in your application descriptor to identify all the required ANEs in your application:
5+
6+
```xml
7+
<extensions>
8+
<extensionID>com.distriqt.AgeRange</extensionID>
9+
<extensionID>com.distriqt.Core</extensionID>
10+
<extensionID>com.jetbrains.kotlin</extensionID>
11+
</extensions>
12+
```
13+
14+
15+
16+
## iOS
17+
18+
19+
20+
### Entitlements
21+
22+
The following additions are for the `Entitlements` node of the iPhone section in your application descriptor:
23+
24+
```xml
25+
<iPhone>
26+
<Entitlements><![CDATA[
27+
28+
HERE
29+
30+
]]></Entitlements>
31+
</iPhone>
32+
```
33+
34+
You need to add the correct entitlement for the **Declared Age Range** capability:
35+
36+
```xml
37+
<key>com.apple.developer.declared-age-range</key>
38+
<true/>
39+
```
40+
41+
42+
## Android
43+
44+
### Manifest Additions
45+
46+
The AgeRange extension only supports API version 23 and higher so you need to specify this in your manifest. You should add the listing below to your manifest.
47+
48+
```xml
49+
<manifest android:installLocation="auto">
50+
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="35" />
51+
52+
<application>
53+
</application>
54+
</manifest>
55+
```
56+
57+
58+
59+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
:::info
3+
The following guide is used to manually install the extension, download dependencies and update the application descriptor. We highly recommend installing extensions using `apm`. Using `apm` will automate the installation and automatically handle updates and dependencies along with greatly simplifying the application descriptor generation.
4+
:::
5+
6+
7+
First step is always to add the extension to your development environment. Download the extension from the repository and then follow the tutorial located [here](/docs/tutorials/getting-started) to add the extension to your development environment.
8+
9+
10+
11+
12+
## Dependencies
13+
14+
Many of our extensions use some common libraries, for example, the Android Support libraries.
15+
16+
We have to separate these libraries into separate extensions in order to avoid multiple versions of the libraries being included in your application and causing packaging conflicts. This means that you need to include some additional extensions in your application along with the main extension file.
17+
18+
You will add these extensions as you do with any other extension, and you need to ensure it is packaged with your application.
19+
20+
21+
### Core
22+
23+
The Core extension is required by this extension. You must include this extension in your application.
24+
25+
The Core extension doesn't provide any functionality in itself but provides support libraries and frameworks used by our extensions.
26+
It also includes some centralised code for some common actions that can cause issues if they are implemented in each individual extension.
27+
28+
You can access this extension here: [https://github.com/distriqt/ANE-Core](https://github.com/distriqt/ANE-Core).
29+
30+
31+
32+
### Android Support
33+
34+
The Android Support libraries encompass the Android Support, Android X and common Google libraries.
35+
36+
These libraries are specific to Android. There are no issues including these on all platforms, they are just **required** for Android.
37+
38+
This extension requires the following extensions:
39+
40+
- [com.jetbrains.kotlin](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.jetbrains.kotlin.ane)
41+
42+
You can access these extensions here: [https://github.com/distriqt/ANE-AndroidSupport](https://github.com/distriqt/ANE-AndroidSupport).
43+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Add the Extension
3+
sidebar_label: AIR
4+
---
5+
6+
import Tabs from '@theme/Tabs'
7+
import TabItem from '@theme/TabItem'
8+
9+
import InstallAPM from './_includes/add-apm.mdx'
10+
import InstallManual from './_includes/add-manual.mdx'
11+
12+
import AppDescriptorAPM from './_includes/add-apm-appdescriptor.mdx'
13+
import AppDescriptorManual from './_includes/add-manual-appdescriptor.mdx'
14+
15+
16+
17+
The simplest way to install and manage your AIR native extensions and libraries is to use the AIR Package Manager (`apm`). We highly recommend using `apm`, as it will handle downloading all required dependencies and manage your application descriptor (Android manifest additions, iOS info additions etc).
18+
19+
However you can choose to install it manually, as you would have done in the past.
20+
21+
22+
## Install
23+
24+
<Tabs
25+
Id="packagemanager"
26+
defaultValue="apm"
27+
values={[
28+
{label: 'APM', value: 'apm'},
29+
{label: 'Manual', value: 'manual'},
30+
]}>
31+
32+
<TabItem value="apm" >
33+
<InstallAPM/>
34+
</TabItem>
35+
<TabItem value="manual" >
36+
<InstallManual/>
37+
</TabItem>
38+
39+
</Tabs>
40+
41+
42+
## Application Descriptor
43+
44+
<Tabs
45+
Id="packagemanager"
46+
defaultValue="apm"
47+
values={[
48+
{label: 'APM', value: 'apm'},
49+
{label: 'Manual', value: 'manual'},
50+
]}>
51+
52+
<TabItem value="apm" >
53+
<AppDescriptorAPM/>
54+
</TabItem>
55+
<TabItem value="manual" >
56+
<AppDescriptorManual/>
57+
</TabItem>
58+
59+
</Tabs>
60+
61+
62+
63+
## Checking for Support
64+
65+
You can use the `isSupported` flag to determine if this extension is supported on the current platform and device.
66+
67+
This allows you to react to whether the functionality is available on the device and provide an alternative solution if not.
68+
69+
70+
```actionscript
71+
if (AgeRange.isSupported)
72+
{
73+
// Functionality here
74+
}
75+
```
76+
77+
78+

docs/agerange/add-the-plugin.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: Add the Plugin
3+
sidebar_label: Unity
4+
---
5+
6+
First step is always to add the plugin to your development environment.
7+
8+
9+
## Asset Store
10+
11+
Open the Asset Store in your browser and add the plugin to your assets.
12+
13+
Open the Package Manager (Window > Package Manager) in the Unity Editor and select the "My Assets" section. Select the plugin, and click Import in the bottom right.
14+
15+
16+
## Manual Installation
17+
18+
In unity you import the package by selecting `Assets / Import Package / Custom Package ...` and then browsing to the unity plugin package file: `com.distriqt.AgeRange.unitypackage`.
19+
20+
![](images/unity-import-package.png)
21+
22+
You can manually download the extension from our repository:
23+
24+
- https://github.com/distriqt/ANE-AgeRange
25+
26+
27+
28+
## Import the Plugin
29+
30+
31+
This will present the import dialog and display all the files for the plugin, make sure all the files are selected.
32+
33+
The plugin will be added to your project and you can now use the plugins functionality in your application.
34+
35+
36+
37+
38+
## Resolve Android Dependencies
39+
40+
This plugin depends on some common Android libraries, particularly the Google Play Core Library, which enables in-app reviews.
41+
42+
You can get these dependencies using one of the following methods.
43+
44+
45+
### Unity Jar Resolver
46+
47+
This is the suggested method.
48+
49+
Use the *Unity Jar Resolver* plugin to download and manage the Android dependencies.
50+
51+
52+
53+
#### Importing
54+
55+
> If you already use the *Unity Jar Resolver* in your project you can skip this step.
56+
57+
- Download the latest version of the [*Unity Jar Resolver*](https://github.com/googlesamples/unity-jar-resolver/releases)
58+
- Import the plugin by selecting `Assets / Import Package / Custom Package ...` and locate the plugin you downloaded. The plugin will be in the zip named: `external-dependency-manager-latest.unitypackage`
59+
- In the *Import Unity Package* window, click Import
60+
61+
62+
#### Resolving
63+
64+
By default, the resolver should run automatically and will add the dependencies required by this plugin.
65+
66+
If you have need to resolve the dependencies manually then you will need to:
67+
68+
- Open the menu under: `Assets / External Dependency Manager / Android Resolver`
69+
- Select `Resolve` or `Force Resolve`
70+
71+
72+
More information on the *Unity Jar Resolver* can be found [here](https://github.com/googlesamples/unity-jar-resolver)
73+
74+
75+
76+
### Custom Gradle AgeRange
77+
78+
Unity's in-built gradle build support and exporting to android studio does not support per plugin gradle script. Therefore, this plugin cannot add the dependencies by itself.
79+
80+
The `mainAgeRange.gradle` is generated when you enable the **Custom Gradle AgeRange** property on the Player window.
81+
82+
The `build.gradle` exists in generated Gradle project when you enable the **Export Project** property on the Player window and Build the project.
83+
84+
Update the `dependencies` section in your `mainAgeRange.gradle` or `build.gradle` as below:
85+
86+
```
87+
dependencies {
88+
compile fileTree(dir: 'libs', include: ['*.jar'])
89+
90+
implementation 'com.google.android.play:core:1.9.1'
91+
}
92+
```
93+
94+
95+
## Checking for Support
96+
97+
You can use the `isSupported` flag to determine if this extension is supported on the current platform and device.
98+
99+
This allows you to react to whether the functionality is available on the device and provide an alternative solution if not.
100+
101+
102+
```csharp
103+
if (AgeRange.isSupported)
104+
{
105+
// Functionality here
106+
}
107+
```

docs/agerange/changelog.md

Whitespace-only changes.

docs/agerange/images/distriqt.png

20.3 KB
Loading

docs/agerange/images/features.png

205 KB
Loading

docs/agerange/images/header.png

161 KB
Loading

0 commit comments

Comments
 (0)