Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Other Does package name on Huawei must end with .huawei?

Discussion in 'Unity Distribution Portal (UDP)' started by Petr777, Oct 7, 2020.

  1. Petr777

    Petr777

    Joined:
    Nov 8, 2017
    Posts:
    36
    We found this during reading Huawei docs:
    https://developer.huawei.com/consumer/en/doc/30202
    6.5 If the game integrates with HUAWEI In-App Purchases, the game package name must end in ".huawei" or ".HUAWEI".

    Does the UDP handles this for us ? Or should we upload our builds with .huawei at the end of package name?
     
  2. Unity-ChiBoon

    Unity-ChiBoon

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    48
    .huawei suffix will be added after you repack the apk in UDP Console for Huawei AppGallery. You don't need to add the .huawei suffix yourself in the package name.
     
    Petr777 likes this.
  3. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    259
    @Unity-ChiBoon, how does this behavior interact with uses of ${applicationId} inside of the app's manifest?

    For example, if my package name is "com.company.example" and I create the APK in Unity, any AAR using ${applicationId} gets that value replaced with "com.company.example".

    However, when I think submit the APK to UDP, the package name changes to "com.company.example.huawei". Does that perform a find/replace across the entire manifest file to handle the spots where ${applicationId} had been substituted?

    I'm a bit worried that the APK won't work after changing the package name if it doesn't also change ${applicationId} expansions in the manifest.

    One other question: if I submit the APK with "com.company.example.huawei" (I already added .huawei manually myself), does the system add another one (com.company.example.huawei.huawei) or is it smart enough to notice that it doesn't need to append in that case?
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    388
    I'm a bit worried that the APK won't work after changing the package name if it doesn't also change ${applicationId} expansions in the manifest.

    -- The package name in the manifest file will also be changed, so change the package name won't affect the apk.

    if I submit the APK with "com.company.example.huawei" (I already added .huawei manually myself), does the system add another one (com.company.example.huawei.huawei) or is it smart enough to notice that it doesn't need to append in that case?
    -- I think the package name will be changed to com.company.example.huawei.huawei in this case, but just as we said on above, you don't have to add .huawei by yourself.
     
  5. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    128
    Hi,

    About this, I added Unity IAP with UDP and it's working fine.
    Now I'm adding HMS Services to use HMS Ads and it requires me to add the file "agconnect-services.json" to my build. That file has inside it a reference to the packagename, so if UDP will change it after repack, it will not work.

    If UDP add .huawei at the end for the IAP to work, then agconnect-services validation will fail because the packagename in there doesn't have .huawei in it.
    And if I add .huawei to the packagename inside the agconnect-services, the build fails because my packagename in unity doesn't have .huawei.

    And if I add .huawei to both, UDP will add .huawei again by itself so it will in the final apk I guess.

    What's the solution to this?

    I think UDP should NOT add .huawei to the packagename if the packagename already ends in .huawei, that's the only solution I can think of.

    Edit:
    I just tested it with a package adding .huawei myself, and you have an option to choose if UDP should add .huawei or not. After repacking my packagename still the same, so it's good if you add the .huawei yourself.
     
    Last edited: Nov 27, 2020
    xLeo and akirayui like this.
unityunity