I have developed a simple app in Xamarin.Forms. Now I am pushing new updates regularly, and I want to inform the app users about the new features. I have seen the NEW
labels on top of new features in UI that appear for a while. (See in the screenshot below).
I want to implement the same label for my app but don't know how to do it.
I have one way to add labels manually to all features I have implemented recently and add a trigger to hide them after people interact with these features. But I think this is a heavy method to add these labels to all features. Is there a proper way?
Note: I use Microsoft App center for app deployment to users.
Asked
Active
Viewed 118 times
0

Naveed Hematmal
- 343
- 4
- 17
-
I think the two methods are one is to write it all in advance as you said, and then use the switch to control the display, and the other is to actively request the new version and update it when you receive the push. – Leo Zhu Jun 21 '21 at 09:58
-
@LeoZhu-MSFT read my question again, it is not about updating. It is about, how to add the `NEW` label to newly added features to the code and app. – Naveed Hematmal Jun 21 '21 at 11:01
-
I know,but you want to add the new label.For an app that has already been compiled and installed on the phone, you can't do this except to install a new version of APK or write some pre-written code. – Leo Zhu Jun 22 '21 at 01:30
-
@LeoZhu-MSFT No! I don't have a problem with the new version, I will deploy a new version. But I need to know how to add `NEW` to these features. It will be a nightmare to add manually these labels in `XAML` – Naveed Hematmal Jun 22 '21 at 07:07
-
Maybe you could try to send a message when you receive the push with [MessagingCenter](https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/messaging-center),you could subscribe it in the page which you want add new label,and then change the ui. – Leo Zhu Jun 22 '21 at 07:10
-
@LeoZhu-MSFT Please answer this question by adding some code snippets. – Naveed Hematmal Jun 22 '21 at 07:19
1 Answers
0
For example:
Here is the page you will add a new label later.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="NewForms.Page12">
<ContentPage.Content>
<StackLayout x:Name ="stacklayout">
<Label Text="Welcome to Xamarin.Forms!"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
public YourPage()
{
InitializeComponent();
MessagingCenter.Subscribe<YourPage>(this, "Add New Label", (sender) =>
{
// Do something whenever the "Add New Label" message is received
Label newLabel = new Label() { Text = "new feature label" };
stacklayout.Children.Add(newLabel );
});
}
Suppose this is the callback method that you received a push:
void receive(){
MessagingCenter.Send<YourPage>(this, "Add New Label");
}

Leo Zhu
- 15,726
- 1
- 7
- 23