Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Jun 7, 2024
1 parent 9c60438 commit 4b211b2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

.DS_Store
.vscode/
.mfractor/
.build/
build/
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

56 changes: 28 additions & 28 deletions src/Shiny.Firebase.Analytics.iOS.Binding/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ interface FirebaseApplication
}


// [BaseType (typeof(NSObject))]
// interface FirebaseAnalytics
// {
// [Static]
// [Export ("logEventWithEventName:parameters:")]
// void LogEvent (string eventName, NSDictionary<NSString, NSObject> parameters);
//
// [Static]
// [Export ("getAppInstanceIdWithCompletion:")]
// [Async]
// void GetAppInstanceId (Action<NSString> completion);
//
// [Static]
// [Export ("setUserIdWithUserId:")]
// void SetUserId (string userId);
//
// [Static]
// [Export ("setUserProperty:value:")]
// void SetUserProperty (string propertyName, string value);
//
// [Static]
// [Export ("setSessionTimeoutWithSeconds:")]
// void SetSessionTimeout (nint seconds);
//
// [Static]
// [Export ("resetAnalyticsData")]
// void ResetAnalyticsData ();
// }
[BaseType (typeof(NSObject))]
interface FirebaseAnalytics
{
[Static]
[Export ("logEventWithEventName:parameters:")]
void LogEvent (string eventName, NSDictionary<NSString, NSObject> parameters);

[Static]
[Export ("getAppInstanceIdWithCompletion:")]
[Async]
void GetAppInstanceId (Action<NSString> completion);

[Static]
[Export ("setUserIdWithUserId:")]
void SetUserId (string userId);

[Static]
[Export ("setUserProperty:value:")]
void SetUserProperty (string propertyName, string value);

[Static]
[Export ("setSessionTimeoutWithSeconds:")]
void SetSessionTimeout (nint seconds);

[Static]
[Export ("resetAnalyticsData")]
void ResetAnalyticsData ();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</ItemGroup>

<ItemGroup Condition="'$(IsIosBuild)' == 'true'">
<ProjectReference Include="..\Shiny.Firebase.Analytics.iOS.Binding\Shiny.Firebase.Messaging.iOS.Analytics.csproj" />
<ProjectReference Include="..\Shiny.Firebase.Messaging.iOS.Binding\Shiny.Firebase.Messaging.iOS.Binding.csproj" />
</ItemGroup>
</Project>
23 changes: 23 additions & 0 deletions src/Shiny.Push/Platforms/Apple/ApplePushNotification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;

namespace Shiny.Push;

/// <summary>
/// The "native" data for iOS in a strongly typed package
/// </summary>
/// <param name="Data">A dictionary of the custom payload data</param>
/// <param name="Aps">NULL if received in the background</param>
/// <param name="Notification">The generic notification details - NULL if in the background</param>
public record ApplePushNotification(
IDictionary<string, string> Data,
Aps? Aps,
Notification? Notification
)
: PushNotification(
Data,
Notification
);

public record Aps(IDictionary<string, string> AdditionalPayloadData, int? Badge, ApsAlert? Alert, ApsSound? Sound, bool? ContentAvailable);
public record ApsAlert(string Title, string Body);
public record ApsSound(bool Critical, string Name, double? Volume);

0 comments on commit 4b211b2

Please sign in to comment.