2

I want to use huawei_push kit in my flutter app but Google Play Store rejected my app because of PendingIntent issues (security rules). I want to use the same source code for Google Play Store and Huawei App Gallery. I was thinking of:

  1. building APK based on flavor (huawei push kit dependencies won't be used in built APK),
  2. using different pubspec.yaml files to avoid huawei push kit dependencies in the whole project.

Question:

How can I use huawei_push kit just for Huawei App Gallery still using the same source code for different stores?

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • hi,i just updated my answer below,pls kindly refer that. And feel free to contact me if you need any further help. :) – zhangxaochen Aug 06 '21 at 09:44
  • 1
    After removing all dependencies related to huawei_push on pipeline, I released new version of the app. The newest version of the app was released a week ago and I haven't gotten any warning since then. In addition - on the 1st of October, huawei_push package has been updated. There is a note in the changelog that issue of Implicit PendingIntent was resolved. – Krzysztof Mamak Oct 10 '21 at 19:12

1 Answers1

1

Update

The problem has been reported to R&D Team. And it's expected to be fixed in the next version.

At the same time, we provide a workaround solution. You may refer to this before next version release.(The Flutter plug-in is open source, so you can modify it directly)

Here's how to modify:

1.Open the pubspec.xml file in the root directory and find the plug-in.Like following:

dependencies:
  flutter:
    sdk: flutter

  huawei_location: 5.0.0+301

You need to find the cache directory of the Flutter, for example:

enter image description here

Find the plug-in directory, for example:

enter image description here

If the plug-in points to a directory, for example:

dependencies:    
    huawei_location:
        path: {library path}

directly access the directory.

2.Modify the build.gradle file in the android directory to modify the SDK version on which the file depends.

For example: implementation 'com.huawei.hms:location:5.1.0.303'

P.S. The PendingIntent issue has been resolved in Push kit 5.3.0.304. So you can directly use this version.

After the modification, run the following command to trigger compilation: flutter run

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • 1
    It is strange but the app with huawei push kit meets all review requirements, but is rejected after publishing in the Google Play Store. I decided to modify dependencies on pipeline (I followed [this](https://github.com/HMS-Core/hms-flutter-plugin/issues/100#issuecomment-893467182) solution) - if it doesn't help, I will follow your solution. Anyway thank you and I will post the feedback soon. – Krzysztof Mamak Aug 13 '21 at 08:13
  • 1
    Hi, I've added a comment on the main thread. – Krzysztof Mamak Oct 10 '21 at 19:13