App.AppName in xamarin form

I am creating a new XF project using 4.0.4.4 XF. I can not find App.AppName anywhere. I am trying to follow https://developer.xamarin.com/guides/xamarin-forms/web-services/authentication/oauth/ where it is specifically mentioned in the docs.

If I create a public property in PCL / App.cs with AppName, it works fine. Is it correct?

Usage in the tutorial The following code example shows how the account object is stored securely on the iOS platform:

AccountStore.Create ().Save (e.Account, App.AppName); 

The following code example shows how the account object is stored securely on the Android platform:

 AccountStore.Create (Context).Save (e.Account, App.AppName); 
+5
source share
2 answers

The โ€œapplicationโ€ in these examples is a subclass of Application :

 public class App : Application 

So, regardless of what you called your solution / project, the name of the Application subclass you created will be:

 public class YourAppNameHere : Application 

Then the AppName to which they refer is the class level variable defined in this class:

 public static string AppName { get { return "TodoListApp"; } } 

Checkout Source @ https://github.com/xamarin/xamarin-forms-samples/blob/master/WebServices/TodoAWSAuth/TodoAWS/TodoAWS-SimpleDB.cs

+7
source

AppName is just the string that AccountStore uses to identify your application. Perhaps sometime the default template template included the AppName property and no longer works, and the documentation is out of date. In any case, just using a solid value or creating your own AppName property should be fine.

+6
source

All Articles