Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What are the main steps to set up Pushwoosh notifications in MvvmCross


What are the main steps to set up Pushwoosh notifications in MvvmCross


To set up Pushwoosh notifications in an MvvmCross application, you need to follow these steps for both Android and iOS platforms. MvvmCross is a framework that simplifies cross-platform development, but it doesn't directly handle push notifications. Instead, you'll integrate Pushwoosh SDKs for each platform.

For Android

1. Set Up Firebase Cloud Messaging (FCM):**
- Open your project in Android Studio and navigate to Tools > Firebase > Cloud Messaging.
- Follow the wizard instructions to set up FCM. This will add necessary dependencies to your `build.gradle` files.

2. Add Pushwoosh SDK:**
- In your `build.gradle`, add the Pushwoosh library dependency. Replace the version with the latest available:

groovy
     implementation 'com.pushwoosh:pushwoosh:latest-version'
     

3. Add Pushwoosh Metadata to AndroidManifest.xml:**
- Open your `AndroidManifest.xml` and add metadata inside the `` tag:

xml
     
     
     

- Add `fcm_sender_id` to your project’s `res/values/strings.xml` file.

4. Initialization Code:**
- In your MvvmCross Android project, initialize Pushwoosh in the startup logic. This typically involves registering for push notifications in a service or activity.

5. Run the Project:**
- Build and run the project. Send a test notification from the Pushwoosh Control Panel to verify setup.

For iOS

1. Install Pushwoosh SDK:**
- Use Swift Package Manager or CocoaPods to integrate the Pushwoosh SDK into your iOS project.
- For CocoaPods, add the dependency to your `Podfile` and run `pod install`.

2. Enable Capabilities:**
- In Xcode, go to Signing & Capabilities and add:
- Push Notifications**
- Background Modes with Remote notifications checked.
- Optionally, add Time Sensitive Notifications for iOS 15+.

3. Add Info.plist Keys:**
- Set `Pushwoosh_APPID` to your Pushwoosh Application Code.
- Optionally, set `PW_API_TOKEN` if required.

4. Initialization Code:**
- In your AppDelegate, initialize Pushwoosh. This involves setting up notification handling and registering for push notifications.

5. Run the Project:**
- Build and run the project. Send a test notification from the Pushwoosh Control Panel to verify setup.

Integrating with MvvmCross

While MvvmCross doesn't directly handle push notifications, you can integrate Pushwoosh into your MvvmCross application by following the platform-specific steps above. You might need to create a custom service or plugin to manage Pushwoosh initialization and notification handling across platforms.

Additional Steps

- Configure Platforms in Pushwoosh Control Panel:**
- Go to the Configure Platforms section in the Pushwoosh Control Panel and set up your iOS and Android configurations.

- Test Notifications:**
- After setting up both platforms, test sending notifications from the Pushwoosh Control Panel to ensure everything works as expected.

By following these steps, you can effectively integrate Pushwoosh notifications into your MvvmCross application for both Android and iOS platforms.

Citations:
[1] https://docs.pushwoosh.com/developer/pushwoosh-sdk/android-sdk/firebase-integration/integrate-pushwoosh-android-sdk/
[2] https://stackoverflow.com/questions/22230399/integrate-pushwoosh-on-ios
[3] https://forum.ionicframework.com/t/sample-code-for-integrating-pushwoosh/12502
[4] https://docs.pushwoosh.com/developer/pushwoosh-sdk/ios-sdk/setting-up-pushwoosh-ios-sdk/basic-integration-guide/
[5] https://www.mvvmcross.com/documentation/getting-started/mvvmcross-overview
[6] https://docs.pushwoosh.com/product/messaging-channels/push-notifications/
[7] https://stackoverflow.com/questions/32371473/pushwoosh-customizing-push-notifications
[8] https://www.mvvmcross.com/documentation/plugins/3rd-party-plugins
[9] https://docs.pushwoosh.com/developer/first-steps/connect-messaging-services/configure-project/
[10] https://help.adjust.com/en/partner-setup/pushwoosh