0

I'm trying to implement push notification, since Hauwei does not support Firebase / Azure Notification Hubs.

As I have it at the moment, I will have a singleton class that is injected during startup that will deal the receipt of the messages and broadcast it into the application with the weakEventManager of mvvm(I prever this pattern), but the issue is to get Hauwei wired up from a platform perspective. I do not want Hauwei libraries in the normal build and do not want google services libraries in Hauwei build. (Nice compiler directive delivery)

Does anyone know how I can achieve this?

Java_Dude
  • 97
  • 9

1 Answers1

0

You can achieve this by adding some logic in build.gradle.

// Define the store to build for in build.gradle
ext.store = 'huawei' // For normal google build can change to google

def isHmsBuild() {
    return project.property('store') == "huawei"
}

if(isHmsBuild()) {
    // Add dependencies or any configuration related HMS
}
Alan Lin
  • 85
  • 1
  • 11
  • I'm doing this in Xamarin. Not sure where that will be since it does not have a build.Gradle. "project.property('store') == "huawei" can you pleaae explain the store? – Java_Dude Nov 26 '22 at 22:36
  • Hi I have update the answer about the "store". Please have a look – Alan Lin Nov 28 '22 at 01:48