braze-inc / braze-xamarin-sdk

Xamarin bindings for the Braze Android and iOS SDKs
https://www.braze.com
Other
3 stars 8 forks source link

`BrazeInAppMessageManager` class does not have function `SetCustomInAppMessageManagerListener` ? #18

Open mbecker73 opened 7 months ago

mbecker73 commented 7 months ago

Hello,

I am trying to upgrade to Braze Xamarin SDK 2.0.1, which binds to Braze Android SDK 26.3.2. My application is currently using Braze Xamarin SDK 1.25.0, which binds to Braze Android SDK 21.0.0.

However, I am getting build errors that the BrazeInAppMessageManager class does not have function SetCustomInAppMessageManagerListener.

Error message: 20>DroidBrazeService.cs(38,47): Error CS1061 : 'BrazeInAppMessageManager' does not contain a definition for 'SetCustomInAppMessageManagerListener' and no accessible extension method 'SetCustomInAppMessageManagerListener' accepting a first argument of type 'BrazeInAppMessageManager' could be found (are you missing a using directive or an assembly reference?)

Code:

BrazeInAppMessageManager.Instance.SetCustomInAppMessageManagerListener(_helper); 
// _helper is instance of custom class that extends DefaultInAppMessageManagerListener

I am importing the following

using Com.Braze;

using Com.Braze.Models.Inappmessage;

using Com.Braze.Models.Outgoing;

using Com.Braze.UI.Inappmessage;

using Com.Braze.UI.Inappmessage.Listeners;

This seems to work in Braze Xamarin SDK 1.25.0, but even upgrading to 1.26.0 causes this build error.

I am not seeing any notes in the changelog related to this, and the docs still mention this function as existing. I am not seeing how else I can set a custom listener to use when displaying in-app messages.

Please advise! Thanks

bryanlogan commented 7 months ago

There is a Xamarin bug that's causing the function to be removed. Is there a reason you can't move to the latest Braze Xamarin SDK? Or even the 3.0.0 release? That has the fix:

mbecker73 commented 7 months ago

Hi @bryanlogan thanks for the response. According to the changelog, the 3.0.0 release "requires using .NET 6+ and removes support for projects using the Xamarin framework". So I don't believe that would work for us

bryanlogan commented 7 months ago

Can you declare the Transforms at https://github.com/braze-inc/braze-xamarin-sdk/blob/master/appboy-component/src/android/Transforms/Metadata.xml#L14 in your compile to force those to be visible?

mbecker73 commented 7 months ago

@bryanlogan I am not sure I am following how that would work in my app project when we are pulling the Braze SDK from nuget. Are you suggesting I fork the repo here and make that change for 2.0.1?

bryanlogan commented 7 months ago

Sorry. You're correct, that way won't work with Nuget. Are you able to fork the repo and try that solution?