Skip to content

Commit

Permalink
More binding fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed May 26, 2024
1 parent 38c08fb commit 9c60438
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 36 deletions.
60 changes: 30 additions & 30 deletions src/Shiny.Firebase.Analytics.iOS.Binding/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@ interface FirebaseApplication
void AutoConfigure();

[Static]
[Export("configure:gcmSenderId:apiKey:projectId")]
bool Configure(string googleAppId, string gcmSenderId, string? apiKey, string? projectId);
[Export("configure:gcmSenderId:apiKey:projectId:")]
bool Configure(string googleAppId, string gcmSenderId, string apiKey, string projectId);

[Static]
[Export("isConfigured")]
bool IsConfigured { get; }
}


[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
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<!--<TargetFrameworks>net8.0-ios;net8.0-maccatalyst</TargetFrameworks>-->
<TargetFramework>net8.0-ios</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<IsBindingProject>true</IsBindingProject>
Expand Down
3 changes: 2 additions & 1 deletion src/Shiny.Firebase.Messaging.iOS.Binding/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Shiny.Firebase.Messaging.iOS.Binding
interface FirebaseMessaging
{
[Static]
[Export("getIsAutoInitEnabled:")]
[Export("getIsAutoInitEnabled")]
bool IsAutoInitEnabled { get; [Bind("setIsAutoInitEnabled:")] set; }

[Static]
Expand Down Expand Up @@ -35,3 +35,4 @@ interface FirebaseMessaging
void UnSubscribe(string topic, Action<NSError?> completion);
}
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<!--<TargetFrameworks>net8.0-ios;net8.0-maccatalyst</TargetFrameworks>-->
<TargetFramework>net8.0-ios</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<IsBindingProject>true</IsBindingProject>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected virtual void TryStartFirebase()
config.ProjectId
);
}

if (!FirebaseApplication.IsConfigured)

Check failure on line 110 in src/Shiny.Push.FirebaseMessaging/Platforms/iOS/FirebasePushProvider.cs

View workflow job for this annotation

GitHub Actions / build

The name 'FirebaseApplication' does not exist in the current context

Check failure on line 110 in src/Shiny.Push.FirebaseMessaging/Platforms/iOS/FirebasePushProvider.cs

View workflow job for this annotation

GitHub Actions / build

The name 'FirebaseApplication' does not exist in the current context
throw new InvalidOperationException("Firebase Application failed to configure - please check your settings");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</ItemGroup>

<ItemGroup Condition="'$(IsIosBuild)' == 'true'">
<!-- <ProjectReference Include="..\Shiny.Firebase.Analytics.iOS.Binding\Shiny.Firebase.Analytics.iOS.Binding.csproj" />-->
<ProjectReference Include="..\Shiny.Firebase.Messaging.iOS.Binding\Shiny.Firebase.Messaging.iOS.Binding.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class FirebaseApplication : NSObject {
return isConfigured()
}


@objc
public static func isConfigured() -> Bool {
return FirebaseApp.app() != nil
}
Expand Down

0 comments on commit 9c60438

Please sign in to comment.