1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-07 11:03:54 +00:00

Add Share app Extension on iOS for Send (re-PR) (#1660)

* WIP Add Share app extension on iOS for Send

* Added Share app extension on iOS for Send and some code fixes as well

* Updated iOS csprojs configs to linkskip the new extension project and also added AdHoc and AppStore configurations to iOS.ShareExtension.csproj

* Code clean up and transformed bundle resources into links to the already used pngs of the main iOS project on ShareExtension

* Updated build.yml to include provisioning profile for iOS Share extension

* Adding in the missing provisioning profile

* Removed .DS_Store from the iOS.ShareExtension csproj Resources

* switching out the share extension profile

* Added Share extension provisioning profile configuration on export options app store for github and also removed custom info.plist config for localhost which is not necessary

* Moved property so that it's grouped with the full ones

* Added AppCenter Crashes package to Core and updated FireAndForget Task Extension

* Updated bundle reference of FontAwesome.ttf to bwi-font.ttf in order for it to compile on ShareExtension

Co-authored-by: Joseph Flinn <joseph.s.flinn@gmail.com>
Co-authored-by: Álison Fernandes <vvolkgang@users.noreply.github.com>
This commit is contained in:
Federico Maccaroni
2022-01-25 17:41:56 -03:00
committed by GitHub
parent ef6184a05b
commit f8a7eb4c94
30 changed files with 1361 additions and 130 deletions

View File

@@ -28,6 +28,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="PCLCrypto" Version="2.0.147" />
<PackageReference Include="zxcvbn-core" Version="7.0.92" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" />
</ItemGroup>
</Project>

View File

@@ -64,6 +64,7 @@ namespace Bit.Core.Services {
var response = await _apiService.RenewFileUploadUrlAsync(uploadData.SendResponse.Id, uploadData.SendResponse.File.Id);
return response.Url;
};
await _azureFileUploadService.Upload(uploadData.Url, encryptedFileData, renewalCallback);
break;
default:

View File

@@ -219,7 +219,7 @@ namespace Bit.Core.Services
{
response = await LegacyServerSendFileUpload(request, send, encryptedFileData);
}
catch
catch
{
if (response != default){
await _apiService.DeleteSendAsync(response.Id);

View File

@@ -0,0 +1,12 @@
using System;
namespace Bit.Core.Utilities
{
public class LazyResolve<T> : Lazy<T>
{
public LazyResolve(string containerKey)
: base(() => ServiceContainer.Resolve<T>(containerKey))
{
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Threading.Tasks;
#if !FDROID
using Microsoft.AppCenter.Crashes;
#endif
namespace Bit.Core.Utilities
{
public static class TaskExtensions
{
/// <summary>
/// Fires a task and ignores any exception.
/// See http://stackoverflow.com/a/22864616/344182
/// </summary>
/// <param name="task">The task to be forgotten.</param>
/// <param name="onException">Action to be called on exception.</param>
public static async void FireAndForget(this Task task, Action<Exception> onException = null)
{
try
{
await task.ConfigureAwait(false);
}
catch (Exception ex)
{
#if !FDROID
Crashes.TrackError(ex);
#endif
onException?.Invoke(ex);
}
}
}
}