# Common problem

# experience demo

# 1. WeChat terminal cooperation platform Fast Experience demo Can not find the Mini Program

a) Determine the input Mini Program appid Is the prefix or suffix the type of space

b) Determine whether the Mini Program has been officially released

# 2. 初始值 demo Can't open Mini Program

a) Start up with two Apk Of, determine the Mini Program framework for this Apk Not started, you have to start the Mini Program framework this Apk Start this again. wmpf Before it starts.

b) Identify the two Apk And see if all permissions are provided.

c) experience demo For the time being, only the official version of the Mini Program is supported, and the experience version and development version of the Mini Program will be supported later.

# Hardware registration

初始值_scdsa_sign It's essentially a paragraph sh Script, available at Linux Or is it Mac Environment, and must ensure that the environment is installed openssl , See for specific usageHardware registrationProcess.

a)mmiot_scdsa_sign.sh: command not found Reporting error It's usually a matter of authority, with sudo bash ./mmiot_ecdsa_sign.sh test

b).mmiot_scdsa_sign.sh gen_ecdsa_key The following parameters can be arbitrarily specified file

# 2. How to check if the signature was successful

a) Available verify_ecdsa_sign inspect

b) Replaceable example demo of productIddeviceIdkeyVersion , and signature , to see if it is running properly If it is not normal, it is usually a parameter input error or openssl Please update the version and try again.

# 3. Hardware Registration FAQ

a) Generation must be operated on the device sudo bash ./mmiot_ecdsa_sign.shgen_ecdsa_keyprikey_filepathpubkey_filepath This order?

The public and private key generated by the server can be stored, not generated on the device.

b) Is the signature generated by the server?

Yes, generate on the device or write a request to the server side access, note that this is a three-way app Ensure that the device signature is secure from theft.

c) Is it possible to build only one model, do not have to control the machine inconsistent?

WMPF The general rule is one key for each model, which is mainly determined by the developer himself.

d) https://api.weixin.qq.com/wxa/business/runtime/adddevice?access_token=YOUR_ACCESS_TOKEN Is this interface a device request once on it?

Yes, the server call once is fine. It is valid forever.

e) transfer mmiot_ecdsa_sign With, losePrivate key file,Signature of each device. signature Is this signature by machine or by model?

Machines, each with its own deviceId And the respective signature Otherwise, there will be an abnormal crowding.

# 4. What exactly does burning mean?

The platform side does not care about how the specific parameters are obtained, in theory, the access party needs to ensure the signature security, burning means that the signature should be placed in the safe storage area or local configuration file or factory configuration file, or it can be the access party server. sd Card, more risk.

# 1. Failed to open Mini Program / Open the Mini Program is not the latest version

a) Determine if the parameters are correct, the public key must be in the WeChat terminal cooperation platform Platform upload, public key can not be used for multiple models, public key format must be correct, KeyVersion Version must be correct and the Mini Program is bound

b) adopt WMPF LaunchWxaAppRequest of appType , determine the development version, official version, experience version

c) If the open Mini Program version is the experience version, the development version of the Mini Program, Users are required to log in first., and the user has the corresponding permissions to open, permissions in the Mini Program management page settings.

d) Does the system install WeChat payment related application? This could lead to ilink Conflict cannot open Open Mini Program

e) Large screen devices need to lock the screen direction in landscape or vertical screen, and then start the Mini Program

# 2. Android Studio Packing, guide and experience The difference between

WMPF Client Demo The project has two flavor Formal development needs to be used guide 。

  • Guide: Used for API Exhibition
  • Experience: For a quick experience

# 3. Do you need to call every time you start the Mini Program ActivateDevice, Authorize interface

  • ActivateDevice To be used for the third party to the request App Therefore, it must be called, and it is recommended that each time the interface is called, if the unused error code is returned, the activation interface is revisited, and activated when the process starts.
  • Authorize For Mini Program login, after login the Mini Program calls wx.login Can get the right code , so as to obtain the relevant information of the user, the access can decide whether to call this interface according to the scene.

inspect appid and appsecret Whether it matches, the process reuses the online acquisition accessToken and sdkTicket Can search the relevant code reference.

Note: The sample code is used to demonstrate the appsecret Placed in the client, access app The process should be moved to the server to avoid risk.

# 5. call LaunchWxaApp Timeout, not responding

It's usually WMPF Service Not started correctly, resulting in an inability to respond, can listen IPCInvokeCallbackEx Relevant error 。

# 6. manageBackgroundMusic and notifyBackgroundMusic difference

  • manageBackgroundMusic For jumping into the Mini Program background audio management page, and can get the current audio playback information.
  • notifyBackgroundMusic Used to monitor Mini Program background audio state changes, such as audio playback pause, recovery, and so on, repeated listening will overwrite the last call.

# 7. Mini Program running process problems

a) Can I log out while the Mini Program is running? Please pass launcher call deauthorize Interface can be.

# 8. Call interface report invokeToken err error

First you need to call the activateDevice Interface, and secondly by utilizing the InvokeTokenHelper.initInvokeToken Saved locally and needs to be brought with each request.

# 9. QR Code Login page, QR code doesn't show up

a) Check if you have already scraped the QR code before. In order to prevent the Mini Program from playing the two-dimensional code all the time, the Mini Program can only be triggered once in its life cycle.

# 10. scanCode Custom scan interface

Mini Program scanCode Interface to support the third party to provide a scan interface, after processing the scan logic back to the wmpf :

a) The access party needs to provide a Action for .com.tencent.wmpf.action.WMPF_SCAN_CODE Accessible to the outside world. Activity , This Ativity Will be in wmpf Call in scanCode After the interface is tuned.

b) The access party needs to be here Activity Parameters for receiving the scan code. The parameters are located in the Intent of Extra The parameters are as follows:

attribute type Introductions
key_time_stamp long Call timestamp
key_Token string Call validation, in the format of MD5(appid + "_" + time_stamp)
key_only_from_camera boolean Whether you can only scan the code from the camera, do not allow to select pictures from the album, the default false
key_scan_type StringArray Scan type, default ['barCode', 'qrCode'] , Optional Value barCode,qrCode,datamatrix,pdf417

c) When the scan is completed and the scan results are processed, the results need to be setResult(code, resultIntent) The form is returned to the wmpf Framework, note that there are two scenarios to deal with here. The scanning process is successful setResult(RESULT_OK, resultIntent) Interrupt the scanning process setResult(RESULT_CANCELED, resultIntent) 。resultIntent You need to bring the scan result data in Extra Middle. The parameters are as follows:

attribute type Introductions
key_scan_result_code_type string Scan type, optional value QR_CODE,AZTEC,CODABAR,CODE_39,CODE_93,CODE_128,DATA_MATRIX,EAN_8,EAN_13,ITF,MAXICODE,PDF_417,RSS_14,RSS_EXPANDED,UPC_A,UPC_E,UPC_EAN_EXTENSION
key_scan_result string Scan result
key_scan_result_raw byteArray The original scan result byteArray data

d) Special scene explaination: If the access party's scan code interface is adjusted, but due to some reasons can not complete the scan code requirements, you need to return to the wmpf Comes with the scan code interface for the next process, you can resultCode Set as -2 , namely, setResult(-2) This will be returned to the Access Side after exiting the scan screen that was switched on. wmpf The built-in scanning interface 。

# 11. IPCInvoker not initialize

Check access App Application Is there an inheritance WMPFApplication 。

# 12. Get Scan User Identity Information

Authorize The interface will return oauthCode , you can go to the original process to obtain relevant information, the specific code see example Demo MainActivity Implementation in.

# 13. Painting parameters

This parameter is modified to true , but you need to customize the Mini Program on the system side activity window Size, this side just informs the system of the expected proportion of the Mini Program

After the picture-in-picture mode is started, from the picture-in-picture mode window to the full-screen mode, the position and size of the Mini Program elements change. Is the interface adaptation of this Mini Program controlled by the Mini Program developer or the Mini Program framework to handle the adaptation?

a) Mini Program developers to deal with resize event

b) The Mini Program framework is in the JS Layer does not provide a picture-in-picture interface. Picture-in-picture here is just the client telling the system to enter a window that is not full-screen, in order to allow Mini Programs and other hardware App To co-exist within the screen, hardware devices should customize the system so that the Mini Program's window does not re-enter full-screen mode.

# 14. The Mini Program is stuck on the tablet loading Page not found

Please lock the device screen orientation in landscape or portrait, and then start the Mini Program.

# 15. Preheating does not take effect

The following reasons may exist:

  • Device not successfully activated
  • Preheat incoming appid、path、appType Is not consistent with the actual opening of the Mini Program
  • Small programs need to be logged in, such as open is the development / Experience version, but the device is not logged in or logged in users do not have the corresponding permissions

# 16. Replacing Mobile Apps AppId After the Mini Program exception is enabled

  • Development version of the Mini Program and experience version of Mini Program, check whether the early login
  • Official version of Mini Program to check if there is a binding relationship between mobile application AppId and Mini Program AppId

# 17. Mini Program call WMPF The Wmpf-Cli side does not receive a request after calling the channel-dependent interface

Check if the relevant provider is configured in AndroidManifest.

# 18. Wmpf flow consumption reference:

  • Activate login process: 80 k
  • Start a Mini Program: the first time(Includes Download Code Pack) Flat mean 4 m Non-first-time 20k
  • Standstill 24h:4m
  • High-frequency use 1h: contains the framework and Mini Program consumption, it is recommended to refer to their own business running Mini Program evaluation, different Mini Program differences, such as Mini Program example 1m(Mostly frame consumption.), electricity supplier class Mini Program 4-6m, live class Mini Program 70-80m, etc.