MAUI Dotnet
SDK integration
1. Add Pushwoosh.DotNet Nuget package to both Android and iOS projects:
2. Accept licenses for transitive Android dependencies if required:
3. Configure your project in Firebase Console.
4. Add google-services.json to the root of your Android platform directory. Set GoogleServicesJson build action for this file:
5. Add the following lines before declaring namespace in your MainActivity.cs (XXXXX-XXXXX here is your Pushwoosh Application ID):
6. In your MainActivity.cs override OnCreate()
method and call PushManager.Init();
after base.OnCreate(savedInstanceState);
7. In your Android project, find the Resources/values/strings.xml file or create it. Add your Sender ID string there:
8. Make the following changes in the AppDelegate.cs of your iOS project:
In the beginning of the FinishedLaunching
method, put the following line:
PushManager.Init();
Add these methods to the AppDelegate (MauiUIApplicationDelegate
class does not export these methods by default, so you have to do it manually):
9. In the Info.plist, change the Pushwoosh_APPID value to your Pushwoosh Application Code. You can find it in your Control Panel:\
10. In the cross-platform part of App.xaml.cs, add the registration to onStart
method:
Note for Windows users: When building you may encounter an issue related to the length of the file path. This is due to the combined length of the directories used by Visual Studio and the file paths within the Pushwoosh SDK exceeding Windows >maximum path length limitation of 260 characters. To resolve this issue, enable the LongPathsEnabled setting in the Windows Registry.
Share your feedback with us
Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.