Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Update publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
lanreolokoba committed Sep 27, 2022
0 parents commit 7106bc4
Show file tree
Hide file tree
Showing 43 changed files with 1,525 additions and 0 deletions.
96 changes: 96 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
## 1.3.0
+ Added `SavePayload` support on the WebGL platform.
+ Added `SavePayload.RequestPermissions` static method to request gallery permissions ahead of time.
+ Added `SavePayload.album` field for inspecting the `album` that was specified when creating the payload.
+ Added `SavePayload.Supported` static field for checking whether the platform supports the payload.
+ Added `SavePayload.Dispose` method for explicitly disposing payload regardless of whether it was saved.
+ Added `SharePayload` support for sharing images with transparency.
+ Added `SharePayload` support for reporting the payload receiver chosen by the user.
+ Added `SharePayload.Supported` static field for checking whether the platform supports the payload.
+ Added `SharePayload.Dispose` method for explicitly disposing payload regardless of whether it was shared.
+ Added NatShare settings menu in project settings, under `NatML > NatShare`.
+ Added `Embed AndroidX` project setting for preventing duplicate errors when embedding AndroidX native library.
+ Fixed share payload task not completing when user canceled sharing action on Android.
+ Refactored top-level namespace from `NatSuite.Sharing` to `NatML.Sharing`.
+ Deprecated `SharePayload.Commit` method. Use `SharePayload.Share` method instead.
+ Deprecated `SavePayload.Commit` method. Use `SavePayload.Save` method instead.
+ Removed `ISharePayload` interface.
+ Removed experimental `PrintPayload`.
+ Updated NatShare license from MIT to Apache 2.0.
+ NatShare now requires iOS 14+.

## 1.2.6
+ NatShare is now thread-safe and can be used from any arbitrary thread.
+ Fixed `FLAG_IMMUTABLE` fatal exception when sharing on Android S (#125).
+ Fixed "Select Photos" option in photo library permission dialog causing app to hang on iOS (#119).

## 1.2.5
+ Migrated to Unity Package Manager.
+ Fixed iOS crash when sharing action was canceled by user (#110).

## 1.2.4
+ Added `ISharePayload.AddImage` overload which takes in a raw pixel buffer.
+ Fixed sharing not working on iOS 14.
+ Fixed `SavePayload` with album name crashing on Android Q+.
+ Fixed `DllNotFoundException` when using any sharing payloads in the Unity Editor.
+ Removed method chaining support from all payloads. Use multiple invocations instead.
+ NatShare now requires Android API level 24+.

## 1.2.3
+ Moved documentation [online](http://docs.natsuite.io/natshare).
+ Fixed compiler errors when building with IL2CPP backend on Android.
+ Fixed "No apps can perform this action" error when sharing text on Android.
+ Reduced time taken when adding images to payloads.
+ NatShare now requires iOS 11+.

## 1.2.2
+ Updated top-level namespace to `NatSuite.Sharing` for parity with other NatSuite API's.
+ Updated `ISharePayload` methods to support chaining, making code easier and more declarative.
+ Implemented `async` pattern for sharing callback using `ISharePayload.Commit` method, further simplifying sharing code.
+ Added boolean return type for `ISharePayload.Commit` showing whether the sharing operation was successfully completed.
+ Fixed UI constraints error when sharing on iPad with iOS 13.
+ Deprecated `ISharePayload.Dispose` method.

## 1.2.1
+ Fixed `SavePayload.AddMedia` not working properly on Android.
+ Fixed `SavePayload` failing to save the first time the user is asked for permissions on iOS.

## 1.2.0
+ Migrated to an object-oriented approach, where sharing payloads are created then committed. See README for more details.
+ Added support for printing on iOS with `PrintPayload`.
+ Added support for sharing multiple items at once.
+ Upgraded API to .NET 4.
+ NatShare now requires Android API level 22+.

## 1.1f3
+ Added support for saving to an album in the camera roll.
+ Added `copy` parameter to `SaveToCameraRoll`. When `false`, the media file will be moved to the camera roll instead of being copied.
+ Deprecated `message` parameter in `Share*` functions.
+ Refactored all `Share*` functions to overloads of one `NatShare.Share` function.

## 1.1f2
+ Added callbacks to the `NatShare.Share...` functions. You can use these to know when the user has completed the sharing activity.
+ Added better error logging on iOS.
+ Changed `NatShare.GetThumbnail` to return the thumbnail texture instead of take a callback.
+ Deprecated the WebGL backend since most functions were not supported.

## 1.1f1
+ Added `ShareText` function for sharing plain text.
+ Added `ShareMedia` function for sharing media files like videos, images, and so on.
+ Refactored `Share` function to `ShareImage`.
+ Correctly set duration of video file being saved to camera roll on Android.
+ Fix creation date on saved video being incorrect on Android.
+ Fix sharing not being available for Instagram and Twitter on iOS.
+ Fix videos not being copied to the top level of the device gallery on Android.

## 1.0f3
+ Images being shared or saved will not appear in a "NatShare" album.
+ Added null checking in all functions to prevent crashing.
+ Fixed hard crash when thumbnail cannot be retreived on iOS.

## 1.0f2
+ Added ability to share images and videos with message.
+ Fixed tearing and skew in generated thumbnails on iOS.

## 1.0f1
+ First release.
7 changes: 7 additions & 0 deletions Changelog.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Editor/AndroidBuildHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* NatShare
* Copyright (c) 2022 NatML Inc. All rights reserved.
*/

namespace NatML.Sharing.Editor {

using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using Internal;

internal sealed class AndroidBuildHelper : IPreprocessBuildWithReport {

public int callbackOrder => 0;

void IPreprocessBuildWithReport.OnPreprocessBuild (BuildReport report) {
// Check
if (report.summary.platform != BuildTarget.Android)
return;
// Embed
EmbedAndroidX();
}

private static void EmbedAndroidX () {
var guids = AssetDatabase.FindAssets("natshare-core");
if (guids.Length == 0)
return;
var path = AssetDatabase.GUIDToAssetPath(guids[0]);
var importer = PluginImporter.GetAtPath(path) as PluginImporter;
importer.SetCompatibleWithPlatform(BuildTarget.Android, NatShareSettings.instance.EmbedAndroidX);
}
}
}
11 changes: 11 additions & 0 deletions Editor/AndroidBuildHelper.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Editor/NatML.Sharing.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "NatML.Sharing.Editor",
"references": [
"NatML.Hub",
"NatML.Hub.Editor",
"NatML.Sharing"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Editor/NatML.Sharing.Editor.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions Editor/NatShareMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* NatShare
* Copyright (c) 2022 NatML Inc. All rights reserved.
*/

namespace NatML.Sharing.Editor {

using UnityEditor;
using Internal;

internal static class NatShareMenu {

private const int BasePriority = 500;

[MenuItem(@"NatML/NatShare " + NatShareSettings.Version, false, BasePriority)]
private static void Version () { }

[MenuItem(@"NatML/NatShare " + NatShareSettings.Version, true, BasePriority)]
private static bool DisableVersion () => false;

[MenuItem(@"NatML/View NatShare Docs", false, BasePriority + 1)]
private static void OpenDocs () => Help.BrowseURL(@"https://docs.natml.ai/natshare");

[MenuItem(@"NatML/Open a NatShare Issue", false, BasePriority + 2)]
private static void OpenIssue () => Help.BrowseURL(@"https://github.com/natmlx/NatShare");
}
}
11 changes: 11 additions & 0 deletions Editor/NatShareMenu.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions Editor/NatShareSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* NatShare
* Copyright (c) 2022 NatML Inc. All Rights Reserved.
*/

namespace NatML.Sharing.Internal {

using UnityEngine;
using UnityEditor;

[FilePath(@"ProjectSettings/NatShare.asset", FilePathAttribute.Location.ProjectFolder)]
internal class NatShareSettings : ScriptableSingleton<NatShareSettings> {

#region --Data--
[SerializeField]
private bool androidx = true;
#endregion


#region --Client API--
/// <summary>
/// Whether to embed the `androidx` support library in the build.
/// </summary>
public bool EmbedAndroidX {
get => androidx;
set {
androidx = value;
Save(false);
}
}
#endregion


#region --Operations--
public const string API = @"ai.natml.natshare";
public const string Version = @"1.3.0";
#endregion
}
}
11 changes: 11 additions & 0 deletions Editor/NatShareSettings.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Editor/NatShareSettingsProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* NatShare
* Copyright (c) 2022 NatML Inc. All rights reserved.
*/

namespace NatML.Sharing.Editor {

using System.Collections.Generic;
using UnityEditor;
using Internal;

internal static class NatShareSettingsProvider {

[SettingsProvider]
public static SettingsProvider CreateProvider () => new SettingsProvider(@"Project/NatML/NatShare", SettingsScope.Project) {
label = @"NatShare",
guiHandler = searchContext => {
EditorGUILayout.LabelField(@"Android Settings", EditorStyles.boldLabel);
NatShareSettings.instance.EmbedAndroidX = EditorGUILayout.Toggle(@"Embed AndroidX Library", NatShareSettings.instance.EmbedAndroidX);
},
keywords = new HashSet<string>(new[] { @"NatML", @"NatCorder", @"NatDevice", @"Hub", @"NatML Hub", @"NatShare" }),
};
}
}
11 changes: 11 additions & 0 deletions Editor/NatShareSettingsProvider.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7106bc4

Please sign in to comment.