OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
606 stars 204 forks source link

[question]: Integrating SDK ships HMS although it's not needed and not set up #868

Open luckyhandler opened 3 months ago

luckyhandler commented 3 months ago

How can we help?

When scanning my app on exodus I saw that HMS is shipped with it. After looking further into it and into the merged Android manifest I saw that this comes from the OneSignal SDK.

 <service
  android:name="com.onesignal.notifications.services.HmsMessageServiceOneSignal"
  android:exported="false">

  <intent-filter>
    <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
  </intent-filter>
</service>

How can I prevent this to be shipped with my app if I don't support Huawei anyway?

Code of Conduct

emawby commented 2 months ago

OneSignal doesn't include Huawei or HMS as a dependency There is a detailed discussion of this in this issue for your reference

OneSignal does have references to HMS push and location, however they are compileOnly in this library. This means no code created by Huawei gets built into your app by default, you have to add directly to your build.gradle as outlined by the setup instructions.

luckyhandler commented 2 months ago

How can it be then included in my merged manifest? @emawby

jkasten2 commented 2 months ago

The AndroidManifest.xml exists in case your app needs to add Huawei push support. It doesn't do anything on it's own, since nothing will generate the com.huawei.push.action.MESSAGING_EVENT event it's own. It can be safely removed if you want, if your app doesn't support HMS push.

Also the com.onesignal.notifications.services.HmsMessageServiceOneSignal contains only OneSignal code, none of it is from Huawei, it simply process push events from them.

luckyhandler commented 2 months ago

@jkasten2 How can I remove it from my manifest? The problem is that this is obviously the reason why my app is labeled as having this tracker although I don't use it. So I definitely want to get rid of it.

Bildschirmfoto 2024-04-19 um 12 01 29