Search code examples
visual-studio-app-centervisual-studio-app-center-push

Can I Remove Push.SetSenderID(string) Now That It's Obsolete?


Is it safe to remove the line of code that calls Microsoft.AppCenter.Push.Push.SetSenderId, which has been marked obsolete?

I updated Microsoft.AppCenter.Push, increased the Xamarin.Android target framework to 8.1, updated AndroidManifest.xml, added google-services.json and updated the proguard config following these steps: https://learn.microsoft.com/appcenter/sdk/push/migration/xamarin-android

However, the following warning is unclear as to whether I can safely delete Microsoft.AppCenter.Push.Push.SetSenderId:

'Push.SetSenderId(string)' is obsolete: 'For all the Android developers using App Center, there is a change coming where Firebase SDK is required to use Push Notifications. For Android P, its scheduled at the release date for the latest OS version. For all other versions of Android, it will be required after April 2019. Please follow the migration guide at https://aka.ms/acfbxa.' (CS0618)

enter image description here


Solution

  • Yes, you can safely delete Microsoft.AppCenter.Push.Push.SetSenderId once you have completed the recommended steps:

    • Increase the Xamarin.Android target framework to 8.1
    • Update AndroidManifest.xml
    • Add google-services.json from Firebase

    After completing the recommended steps, Microsoft.AppCenter.Push.Push.SetSenderId will no longer execute any code in the SDK (it is essentially a no-op).