Below is an issue that was recently reported on, the developer in question wrote the below about what happened when they attempted to use the redelivery button on the failed orders report.
Our project integrated In-App Purchases. When I viewed the AppGallery Connect report, I found that there is a failed order data, and a redelivery button next to it. I thought the problem would be resolved after I clicked on the button.
However, nothing happened after I clicked on the button. Our server did not call back the payment result to trigger the redelivery.
SolutionIn this case, you can submit a ticket to contact with our Huawei technical support.
In our own game’s QQ group, I asked the SDK technical support about this case, and got a quick reply:
The redelivery button works when the integrated IAP SDK version is 2.X and the payment callback address has been configured for the game. Clicking on the button will trigger the payment callback on the game server. The game server then redelivers the product. Tips: The IAP SDK 2.X will be removed from the market. If you are still using the old version, update the SDK as soon as possible.
If the version of the IAP SDK is 3.X or later (our integrated version is 5.0), the redelivery button does not work, and you’ll need to trigger the redelivery mechanism in the following scenarios:
When the app launches.
When the result code -1 (OrderStatusCode.ORDER_STATE_FAILED) is returned for a purchase request.
When the result code 60051 (OrderStatusCode.ORDER_PRODUCT_OWNED) is returned for a purchase request.
The client then calls the obtainOwnedPurchases API to query the failed order, and sends the data to the server, which will redeliver the product.
References:For details about the redelivery mechanism for IAP SDK 3.X or later, please refer to Redelivery Process for Consumables.
Related
Symptom
When I submitted my app to AppGallery Connect for self-check, the following message was displayed:
MAJOR:22: Integrate the version update API (checkUpdate). If you already integrate the API, check whether the HMS SDK code is obfuscated in the configuration file. For details about how to modify the configuration file, visit https://developer.huawei.com/consum...es/appgallerykit-preparation#h1-1574846682104.
Analysis
To determine the reason for integrating the API, I submitted a ticket to Huawei technical support in the following link:
https://developer.huawei.com/consumer/en/support/feedback
I was told that this API is required for joint operations games and apps for which HUAWEI AppGallery Connect Distribution Service Agreement For Paid Apps is signed. For details about how to integrate the API, please refer to:
Joint operations games:
https://developer.huawei.com/consum...lery-connect-Guides/appgallerykit-game-update
Joint operations apps:
https://developer.huawei.com/consum...llery-connect-Guides/appgallerykit-app-update
If you have not signed HUAWEI AppGallery Connect Distribution Service Agreement For Paid Apps, check whether corresponding resource files for the IAP SDK or DRM SDK have been introduced to your app project. If so, the self-check tool will regard your app as a joint operations app, and prompt you to integrate the checkUpdate API. In this case, delete the related resources and perform the self-check again.
Solution
In addition to joint operations apps that integrate the IAP SDK, other apps have introduced resource files.
Then, after I had deleted the IAP-related resource files, based on the reply from Huawei technical support, the problem was ultimately resolved during self-check.
SymptomAfter my game was submitted for review, it was rejected by Huawei because the floating window is not displayed when no HUAWEI ID is signed in.
I have checked my test environment: connected to Wi-Fi, used Android and EMUI versions complying with the specifications, and used the environment in English.
Suggestion: Rectify the fault based on the test result.
SolutionAfter I submitted a ticket at Huawei support, Huawei technical support gave the following reply to me:
1. Use a Huawei phone running a version earlier than EMUI 9.1.1 for the test (for Huawei phones running EMUI 9.1.1 or later, HMS Core automatically displays the game floating window). Alternatively, use a non-Huawei phone (with HUAWEI AppGallery downloaded from the Huawei official website and installed) where HMS Core (APK) has been uninstalled to reproduce the problem.
2.Closely follow the instructions in the document to call related APIs.
Call the showFloatWindow API in the onResume method and call the hideFloatWindow API in the onPause method. The hideFloatWindow API can be called only after the showFloatWindow API has been called to display the game floating window on the game UI.
3. Note that the game must call the showFloatWindow API immediately after initialization, instead of after a successful sign-in.
Based on the preceding reply, I found that my game called the showFloatWindow API after a successful sign-in. That’s what caused the rejection.
I also found the following post about Huawei floating window exceptions for your reference:
https://forums.developer.huawei.com/forumPortal/en/topic/0203417554929060009?fid=0101188387844930001
SymptomAfter integrating the HMS Core SDK into my game, I submitted it for review, but it was rejected because improper processing of a payment delay had caused product delivery failure when a user made a payment using HUAWEI Points. I simulated a payment crash (by forcibly closing the game before tapping OK after making a payment), restarted the game, and found that the in-app product I had bought was not successfully delivered.
AnalysisAfter submitting a ticket on HUAWEI Developers, Huawei technical support asked me to perform the following self-check to diagnose the problem:
After making a payment, instead of tapping OK on the screen, forcibly close the game instead. This simulates the scenario where the game does not receive a payment success callback from Huawei. Then restart the game and check whether the purchased product has been delivered. If not, the redelivery mechanism is abnormal and the game will be rejected. When the problem recurred during testing, it is found that the product has not been delivered indeed.
Huawei provides the obtainOwnedPurchases API for redelivery, which needs to be called when an order is missing due to exceptions including network errors and processes failing to respond.
You can implement the redelivery by referring to this material.
SolutionI checked the code and found redelivery was performed only for result code 60051. It seemed that I hadn’t dealt with the first two scenarios. I modified the code and submitted my game for review again. My game was then approved.
Contact Shield is a basic contact diagnosis service developed based on the Bluetooth low energy (BLE) technology. Global public health institutions can authorize developers to develop COVID-19 contact diagnosis apps using Contact Shield APIs. These apps can interact with other devices while protecting user privacy to check whether a user has been in contact with a person tested positive for COVID-19. If so, the user will be notified and instructed to take relevant measures, effectively controlling the spread of the virus.
Working Principles
1. The mobile phone of B broadcasts the DSC (Dynamic Sharing Code). The phone can generate a DSC collection based on the periodic key on each day, select a DSC based on the current time, and broadcast the DSC to surrounding devices through BLE.
2. The mobile phone of A receives the DSC broadcast by B. After scanning the DSC broadcast by the mobile phone of B, the mobile phone of A records the current timestamp and received signal strength indicator (RSSI), and stores the data in a local database.
3. If B is diagnosed as a COVID-19 patient, the app obtains authorization from B and uploads the periodic key within the virus incubation period (14 days by default) to the app server or the server specified by a public health institution. In this case, the periodic key of B is called the shared key.
4. The app of A periodically downloads the compressed package of periodic keys of the diagnosed user from the server and calls Contact Shield to perform contact diagnosis. Contact Shield deduces the DSC collection broadcast by the diagnosed person based on the periodic keys provided by the app.
5. During contact diagnosis, Contact Shield uses the DSC collection generated in 4 to match a record in the DSC data table of the last 14 days stored in the local database. After the matching is complete, Contact Shield generates a diagnosis report and notifies A of the contact diagnosis result through the app.
Based on the diagnosis report, A knows whether he or she has been in close contact with the diagnosed user and the potential contact risk level.
When the Contact Shield invokes the interface, the error code -1 is returned. There are many possible causes in this scenario. This section describes the troubleshooting procedure for this error code.
\Note: If the error code -1 is displayed, view the error log and search for the keyword HmsNearbyKit_sdk_ContactApiImpl. Generally, the log contains an error code with the actual error cause.
1. Developer have not applied for the Contact Shield permission (Error code 6004).
Cause 1:
Unlike other HMS SDKs, the Contact Shield SDK requires developers to send related information through emails to grant permissions.
For details about how to apply for the contact guard API permission, see:
https://developer.huawei.com/consum...equest-access-0000001058448610?ha_source=hms1
Cause 2:
The agconnect-services.json file in the local project does not match.
Check whether the agconnect-services.json file added to the local project is the same as the required agconnect-services.json file.
You can download the new agconnect-services.json file from the AGC official website and commission the project again.
For details about how to download the agconnect-services.json file, see:https://developer.huawei.com/consum...-integratesdk-0000001058897058?ha_source=hms1
2. The generated APK signature file (.keystore or .jks file) is different from the SHA-256 information configured on the AGC. (Error code 6003).
The APK signature file must be the same as the signature configured on the AGC.
The configuration procedure is as follows:
https://developer.huawei.com/consum...ld-config-agc-0000001057648627?ha_source=hms1
3. When the API is invoked for the first time, the mobile phone is not connected to the network.
When the contact guard API is invoked for the first time, if the mobile phone is not connected to the network, the error code -1 is returned.
In this scenario, ensure that the network connection is normal and invoke the Contact Shield API again.
4. After the startContactShield() interface is invoked, the pop-up message is manually canceled.After the startContactShield() interface is invoked, the following dialog box is displayed.
User must select Allow to invoke the Contact Shield API.
Note: The error code in the latest Contact Shield has been updated to 8015.
5. User do not have the location permission of the HMS Core APK.When the startContactShield() interface is invoked, in addition to the pop-up for point 4, the dialog box shown in the following figure is displayed if you do not have the location permission.
User must select “ALLOW ALL THE TIME”to invoke the Contact Shield API.
Note: The error code in the latest Contact Shield has been updated to 8103.
To view the permission, choose Settings > Apps > Apps > Search HMS Core > Permissions > location.
6. When the putSharedKeyFiles() interface is invoked, the file format provided by the developer is incorrect.When the putSharedKeyFiles interface of the Contact Shield is invoked, the transferred file in List<File> files is incorrect.
The format and generation method of this file are the same as those in Google's Exposure Notifications.
For more details, you can go to:
l Our official website
l Our Development Documentation page, to find the documents you need
l Reddit to join our developer discussion
l GitHub to download demos and sample codes
l Stack Overflow to solve any integration problems
Original Source
SymptomI integrated HUAWEI IAP into my app and called the {rootUrl}/applications/purchases/tokens/verify API by referring to the official documentation, but error message {"responseCode":"8","responseMessage":"wrong application"} was returned.
TroubleshootingI contacted Huawei technical support and they gave the following reply to me:
To minimize the access to private user data (including order data), Huawei only retains the latest purchase of a product by a user. Once after a user buys a product and completes payment, the product is delivered and the consumeOwnedPurchase API is called, and the order is complete and closed. In this case, do not call the verifying API for an earlier order. Otherwise, the error will occur.