Skip to content

Commit 26ec7dd

Browse files
committed
widgetcenter v0.0.1
1 parent 263d657 commit 26ec7dd

File tree

15 files changed

+650
-0
lines changed

15 files changed

+650
-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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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.AppleSignIn
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.WidgetCenter.ane # WidgetCenter 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+
41+
42+
- You will need to set the configuration values for usage in the extension. Call the following to step through the configuration values for this extension:
43+
44+
```
45+
apm project config set com.distriqt.WidgetCenter
46+
```
47+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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.WidgetCenter</extensionID>
9+
<extensionID>com.distriqt.Core</extensionID>
10+
<extensionID>androidx.core</extensionID>
11+
</extensions>
12+
```
13+
14+
15+
16+
## iOS
17+
18+
19+
### Info Additions
20+
21+
22+
The following additions are for the `InfoAdditions` node of the iPhone section in your application descriptor:
23+
24+
```xml
25+
<iPhone>
26+
<InfoAdditions><![CDATA[
27+
28+
HERE
29+
30+
]]></InfoAdditions>
31+
</iPhone>
32+
```
33+
34+
35+
36+
## Android
37+
38+
### Manifest Additions
39+
40+
The WidgetCenter extension requires a few additions to the manifest to be able to start certain activities. You should add the listing below to your manifest.
41+
42+
:::caution
43+
Ensure you replace:
44+
- `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.
45+
:::
46+
47+
48+
```xml
49+
<manifest android:installLocation="auto">
50+
<uses-permission android:name="android.permission.INTERNET"/>
51+
52+
<application android:hardwareAccelerated="true">
53+
54+
55+
</application>
56+
</manifest>
57+
```
58+
59+
60+
61+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
- [androidx.core](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.core.ane)
41+
42+
You can access these extensions here: [https://github.com/distriqt/ANE-AndroidSupport](https://github.com/distriqt/ANE-AndroidSupport).
43+
44+
45+
46+
47+
### Google Play Services
48+
49+
This extension requires usage of certain aspects of the Google Play Services client library.
50+
The client library is available as a series of extensions that you add into your applications packaging options.
51+
Each separate extension provides a component(s) from the Play Services client library and are used by different extensions.
52+
53+
These client libraries aren't packaged with this extension as they are used by multiple ANEs and separating them
54+
will avoid conflicts, allowing you to use multiple extensions in the one application.
55+
56+
This extension requires the following Google Play Services:
57+
58+
- [com.distriqt.playservices.Base.ane](https://github.com/distriqt/ANE-GooglePlayServices/raw/master/lib/com.distriqt.playservices.Base.ane)
59+
60+
You must include the above native extensions in your application along with this extension,
61+
and you need to ensure they are packaged with your application.
62+
63+
You can access the Google Play Services client library extensions here:
64+
[https://github.com/distriqt/ANE-GooglePlayServices](https://github.com/distriqt/ANE-GooglePlayServices).
65+
66+
67+
> **Note:** The Google Play Services and Android Support ANEs are only **required** on Android devices.
68+
> There are no issues packaging these extensions with all platforms as there are default implementations available which will allow your code to package without errors however if you are only building an iOS application feel free to remove the Google Play Services and Android Support ANEs from your application.
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.md'
10+
import InstallManual from './_includes/add-manual.md'
11+
12+
import AppDescriptorAPM from './_includes/add-apm-appdescriptor.md'
13+
import AppDescriptorManual from './_includes/add-manual-appdescriptor.md'
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 (WidgetCenter.isSupported)
72+
{
73+
// Functionality here
74+
}
75+
```
76+
77+
78+
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.WidgetCenter.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-WidgetCenter
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 WidgetCenter
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 `mainWidgetCenter.gradle` is generated when you enable the **Custom Gradle WidgetCenter** 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 `mainWidgetCenter.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 (WidgetCenter.isSupported)
104+
{
105+
// Functionality here
106+
}
107+
```

docs/widgetcenter/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### 2025.09.30 [v0.0.1]
2+
3+
```
4+
initial release
5+
```
6+
20.3 KB
Loading
161 KB
Loading

docs/widgetcenter/images/hero.png

189 KB
Loading

0 commit comments

Comments
 (0)