Skip to content

Commit

Permalink
Develop
Browse files Browse the repository at this point in the history
  • Loading branch information
michaela-dev committed Nov 26, 2021
1 parent f6cd377 commit 79fa1a2
Showing 57 changed files with 2,533 additions and 297 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
bin/
obj/
packages/
Carthage/
build/
frameworks/
.vs/
*.csproj.user
/ios/native SDK wrapper/Cartfile.resolved

/ios/native SDK wrapper/ExponeaSDKProxy/build
/ios/native SDK wrapper/ExponeaSDKProxy/Cartfile.resolved
/ios/native SDK wrapper/ExponeaSDKProxy/Carthage
/ios/native SDK wrapper/ExponeaSDKProxy/frameworks

8 changes: 6 additions & 2 deletions android/ExponeaSDK.Android.csproj
Original file line number Diff line number Diff line change
@@ -20,16 +20,17 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<PackOnBuild>true</PackOnBuild>
<PackageId>ExponeaSDK.Android</PackageId>
<PackageVersion>0.2.0</PackageVersion>
<PackageVersion>0.2.1</PackageVersion>
<Authors>Exponea</Authors>
<Copyright>Exponea</Copyright>
<Owners>Exponea</Owners>
<Title>ExponeaSDK.Android</Title>
<Description>Binding library for Exponea Android SDK</Description>
<ReleaseVersion>0.2.0</ReleaseVersion>
<ReleaseVersion>0.2.1</ReleaseVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
<Summary>Binding library for Exponea Android SDK</Summary>
<PackageLicenseUrl>https://spdx.org/licenses/MIT</PackageLicenseUrl>
<PackageIconUrl>https://media-exp1.licdn.com/dms/image/C560BAQG46ev9qjCTbQ/company-logo_200_200/0/1631723320052?e=2159024400&amp;v=beta&amp;t=ZgeKC90wtfA47irF7Ds8Bs59WPIjMvi1VH1HWsJNqUQ</PackageIconUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -100,6 +101,9 @@
<PackageReference Include="ExponeaSDK.Android.PaperDB">
<Version>0.1.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Room.Runtime">
<Version>2.2.5.5</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<LibraryProjectZip Include="Jars\sdk-release.aar" />
Binary file modified android/Jars/sdk-release.aar
Binary file not shown.
3 changes: 2 additions & 1 deletion android/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;

@@ -24,3 +23,5 @@
// Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: MetaData("ExponeaXamarinSDK", Value = "true")]

20 changes: 11 additions & 9 deletions documentation/IOS_PUSH.md
Original file line number Diff line number Diff line change
@@ -240,21 +240,23 @@ Create a new Notification Service Extension and give it `App Groups` capability

![](./pics/extension2.png)

In the extension, you have to call Exponea methods for processing notifications and handling timeouts.
In the extension, you have to call Exponea methods for processing notifications and handling timeouts. For iOS extensions, separate App-Extension safe dependency was created. Use ExponeaSDK.iOS.Notifications package as dependecy in extensions.

``` csharp

using System;
using Foundation;
using UserNotifications;
using Exponea.iOS;
using ExponeaSdkNotifications;

namespace ExamplePushServiceExtension
{
[Register("NotificationService")]
public class NotificationService : UNNotificationServiceExtension
{

ExponeaNotificationHandler notificationHandler = new ExponeaNotificationHandler("group.com.exponea.xamarin");

#region Constructors
protected NotificationService(IntPtr handle) : base(handle)
{
@@ -265,12 +267,12 @@ namespace ExamplePushServiceExtension
#region Override Methods
public override void DidReceiveNotificationRequest(UNNotificationRequest request, Action<UNNotificationContent> contentHandler)
{
ExponeaNotificationHandler.Instance.ProcessNotificationRequest(request, contentHandler, "group.com.exponea.xamarin");
notificationHandler.HandleNotificationRequest(request, contentHandler);
}

public override void TimeWillExpire()
{
ExponeaNotificationHandler.Instance.TimeWillExpire();
notificationHandler.TimeWillExpire();
}
#endregion
}
@@ -284,12 +286,9 @@ namespace ExamplePushServiceExtension

Create a new Notification Content Extension. By default, the extension will contain a storyboard file that you can delete; we'll change the default view controller implementation. The service extension that we created in the previous step will change the notification `categoryIdentifier` to `EXPONEA_ACTIONABLE`. We have to configure the content extension to display push notifications with that category. Open `Info.plist` in created content extension group and add `UNNotificationExtensionCategory`. Next, remove `NSExtensionMainStoryboard` and instead use `NSExtensionPrincipalClass` set to your view controller.



Notice the parameter `UNNotificationExtensionInitialContentSizeRatio` (with the default value 1). It specifies the ratio between the width and the height of the content in the push notification. By default, the content is as high as it's wide. This setting is not part of the SDK, but it can cause showing white space when notification is without the content (image). Change this value to 0 if you want the height to be dynamic (it will grow to the needed height if there is an image present, but there will be no blanc space if there is not).



We also recommend to set `UNNotificationExtensionUserInteractionEnabled` and `UNNotificationExtensionDefaultContentHidden` attributes to true.


@@ -306,14 +305,17 @@ using Foundation;
using UIKit;
using UserNotifications;
using UserNotificationsUI;
using Exponea.iOS;
using ExponeaSdkNotifications;


namespace ExamplePushContentExtension
{

public partial class NotificationViewController : UIViewController, IUNNotificationContentExtension
{

ExponeaNotificationHandler notificationHandler = new ExponeaNotificationHandler("group.com.exponea.xamarin");

#region Constructors
protected NotificationViewController(IntPtr handle) : base(handle)
{
@@ -334,7 +336,7 @@ namespace ExamplePushContentExtension
[Export("didReceiveNotification:")]
public void DidReceiveNotification(UNNotification notification)
{
ExponeaNotificationHandler.Instance.HandlePushNotificationReceived(notification, ExtensionContext, this);
notificationHandler.HandleNotificationReceived(notification, ExtensionContext, this);
}
#endregion
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props')" />
<Import Project="..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
@@ -90,44 +90,44 @@
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
<Reference Include="ExponeaSDK.iOS">
<HintPath>..\packages\ExponeaSDK.iOS.0.2.0\lib\xamarinios10\ExponeaSDK.iOS.dll</HintPath>
</Reference>
<Reference Include="System.Drawing.Common.dll" />
<Reference Include="Microsoft.Bcl.AsyncInterfaces">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="System.Buffers">
<HintPath>..\packages\System.Buffers.4.5.1\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web">
<HintPath>..\packages\System.Text.Encodings.Web.5.0.1\lib\netstandard2.1\System.Text.Encodings.Web.dll</HintPath>
<HintPath>..\packages\System.Text.Encodings.Web.6.0.0\lib\netstandard2.0\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json">
<HintPath>..\packages\System.Text.Json.5.0.2\lib\netstandard2.0\System.Text.Json.dll</HintPath>
<HintPath>..\packages\System.Text.Json.6.0.0\lib\netstandard2.0\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Essentials">
<HintPath>..\packages\Xamarin.Essentials.1.7.0\lib\xamarinios10\Xamarin.Essentials.dll</HintPath>
</Reference>
<Reference Include="OpenTK-1.0" />
<Reference Include="System.Numerics" />
<Reference Include="ExponeaSdk">
<HintPath>..\packages\ExponeaSDK.0.2.0\lib\xamarinios10\ExponeaSdk.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="System.Memory">
<HintPath>..\packages\System.Memory.4.5.4\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="NativeLibrary">
<HintPath>..\packages\ExponeaSDK.iOS.Notifications.0.2.1\lib\xamarinios10\NativeLibrary.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -145,6 +145,7 @@
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.AppExtension.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Android.Google.Code.Gson.2.8.8\build\Xamarin.Android.Google.Code.Gson.targets" Condition="Exists('..\packages\Xamarin.Android.Google.Code.Gson.2.8.8\build\Xamarin.Android.Google.Code.Gson.targets')" />
<Import Project="..\packages\System.Text.Json.6.0.0\build\System.Text.Json.targets" Condition="Exists('..\packages\System.Text.Json.6.0.0\build\System.Text.Json.targets')" />
<Import Project="..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.targets')" />
</Project>
Original file line number Diff line number Diff line change
@@ -3,14 +3,17 @@
using UIKit;
using UserNotifications;
using UserNotificationsUI;
using Exponea.iOS;
using ExponeaSdkNotifications;


namespace ExamplePushContentExtension
{

public partial class NotificationViewController : UIViewController, IUNNotificationContentExtension
{

ExponeaNotificationHandler notificationHandler = new ExponeaNotificationHandler("group.com.exponea.xamarin");

#region Constructors
protected NotificationViewController(IntPtr handle) : base(handle)
{
@@ -31,7 +34,7 @@ public override void ViewDidLoad()
[Export("didReceiveNotification:")]
public void DidReceiveNotification(UNNotification notification)
{
ExponeaNotificationHandler.Instance.HandlePushNotificationReceived(notification, ExtensionContext, this);
notificationHandler.HandleNotificationReceived(notification, ExtensionContext, this);
}
#endregion
}
15 changes: 8 additions & 7 deletions example/ExamplePushContentExtension/packages.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ExponeaSDK" version="0.2.0" targetFramework="xamarinios10" />
<package id="ExponeaSDK.iOS" version="0.2.0" targetFramework="xamarinios10" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="xamarinios10" />
<package id="ExponeaSDK.iOS.Notifications" version="0.2.1" targetFramework="xamarinios10" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="xamarinios10" />
<package id="System.Buffers" version="4.5.1" targetFramework="xamarinios10" />
<package id="System.Memory" version="4.5.4" targetFramework="xamarinios10" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="xamarinios10" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="xamarinios10" />
<package id="System.Text.Encodings.Web" version="5.0.1" targetFramework="xamarinios10" />
<package id="System.Text.Json" version="5.0.2" targetFramework="xamarinios10" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="xamarinios10" />
<package id="System.Text.Encodings.Web" version="6.0.0" targetFramework="xamarinios10" />
<package id="System.Text.Json" version="6.0.0" targetFramework="xamarinios10" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="xamarinios10" />
<package id="Xamarin.Android.Google.Code.Gson" version="2.8.8" targetFramework="xamarinios10" />
<package id="Xamarin.Essentials" version="1.7.0" targetFramework="xamarinios10" />
<package id="Xamarin.Forms" version="5.0.0.2125" targetFramework="xamarinios10" />
<package id="Xamarin.Forms" version="5.0.0.2196" targetFramework="xamarinios10" />
</packages>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props')" />
<Import Project="..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
@@ -90,44 +90,44 @@
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
<Reference Include="ExponeaSDK.iOS">
<HintPath>..\packages\ExponeaSDK.iOS.0.2.0\lib\xamarinios10\ExponeaSDK.iOS.dll</HintPath>
</Reference>
<Reference Include="System.Drawing.Common.dll" />
<Reference Include="Microsoft.Bcl.AsyncInterfaces">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="System.Buffers">
<HintPath>..\packages\System.Buffers.4.5.1\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web">
<HintPath>..\packages\System.Text.Encodings.Web.5.0.1\lib\netstandard2.1\System.Text.Encodings.Web.dll</HintPath>
<HintPath>..\packages\System.Text.Encodings.Web.6.0.0\lib\netstandard2.0\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json">
<HintPath>..\packages\System.Text.Json.5.0.2\lib\netstandard2.0\System.Text.Json.dll</HintPath>
<HintPath>..\packages\System.Text.Json.6.0.0\lib\netstandard2.0\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Essentials">
<HintPath>..\packages\Xamarin.Essentials.1.7.0\lib\xamarinios10\Xamarin.Essentials.dll</HintPath>
</Reference>
<Reference Include="OpenTK-1.0" />
<Reference Include="System.Numerics" />
<Reference Include="ExponeaSdk">
<HintPath>..\packages\ExponeaSDK.0.2.0\lib\xamarinios10\ExponeaSdk.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.5.0.0.2125\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.5.0.0.2196\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="System.Memory">
<HintPath>..\packages\System.Memory.4.5.4\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="NativeLibrary">
<HintPath>..\packages\ExponeaSDK.iOS.Notifications.0.2.1\lib\xamarinios10\NativeLibrary.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -142,6 +142,7 @@
<Compile Include="NotificationService.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.AppExtension.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Android.Google.Code.Gson.2.8.8\build\Xamarin.Android.Google.Code.Gson.targets" Condition="Exists('..\packages\Xamarin.Android.Google.Code.Gson.2.8.8\build\Xamarin.Android.Google.Code.Gson.targets')" />
<Import Project="..\packages\System.Text.Json.6.0.0\build\System.Text.Json.targets" Condition="Exists('..\packages\System.Text.Json.6.0.0\build\System.Text.Json.targets')" />
<Import Project="..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.5.0.0.2196\build\Xamarin.Forms.targets')" />
</Project>
Loading

0 comments on commit 79fa1a2

Please sign in to comment.