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

Why doesn't the HandleCardUpdate method execute automatically here? #17

Closed Vito258 closed 7 months ago

Vito258 commented 1 year ago

I am using the MAUI framework. Here is the code: public class NoticeListFragment: ContentCardsFragment { public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState);

     ContentCardUpdateHandler = new NoticeContentHandler();

 }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

{

 var view = inflater.Inflate(Resource.Layout.TestLayout, container, false);

 return view;

}

public class NoticeContentHandler : Java.Lang.Object, IContentCardsUpdateHandler { public int DescribeContents() { throw new NotImplementedException(); }

 public IList<Card> HandleCardUpdate(ContentCardsUpdatedEvent p0)
 {
    throw new NotImplementedException();
 }

} And I have defined a TextView in the TestLayout, but the text inside it doesn't show up either.This is the TestLayout.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:maui="clr-namespace:Microsoft.Maui.Controls;assembly=Microsoft.Maui.Controls" android:id="@+id/linear_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_blue_light"

<TextView
    android:id="@+id/textView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:text="Hello,World"
    android:textSize="50sp"
    android:textColor="@android:color/holo_red_light"
    android:cursorVisible="true"/>

radixdev commented 1 year ago

Hello @Vito258 ,

That listener fires when a content card update is available and would require a Content Card refresh or update to be fired. Please include your detailed reproduction steps for us to proceed.

hokstuff commented 7 months ago

I'm closing out this thread due to inactivity. If you are still experiencing this issue, please provide more information in an email to support@braze.com. Thanks!