Forum General

How to use AppCenter Analytics on .net Core WebApi backend to avoid saving secret on device?

effahidvissahideffahidvissahid USMember ✭✭


I'm able to send events to from my XamarinForms App . However, sending the events requires the app secret key to be added to the android/ios app itself. This key can be easily extracted using a decompiler.

On my webapi backend, like the Xamarin app, I tried adding the nuget package and then in Startup.cs
AppCenter.Start("SECTETKEYHERE", typeof(Analytics))

And then tracking the event this way

Analytics.TrackEvent("MyTestEvent",new Dictionary<string, string>{{"EventNameHere","EventValueHere"}});

However, no event data ever arrives in the appcenter dashboard.
So my question is , how do I use the trackevent functionality on the serverside, or , at the very least, store the key on the app side securely(I'd really rather not do this).

My fallback plan is to use google analytics as it works fine .


  • Amar_BaitAmar_Bait DZMember ✭✭✭✭✭
    edited December 2018

    There's nothing dangerous in including AppCenter key in your app, since it's a public key. All analytics services work the same way, even Google Analytics (the key is set in the google play json file which can be read from the apk too...). It's not an access token, it doesn't give access to you AppCenter account. It's just to identify your app. Worst case scenario: someone else will use your key in his app and his numbers will add to yours. But don't see why someone would do that honestly...

Sign In or Register to comment.