FAQ for proprietary apps

更新时间:
复制 MD 格式

This topic addresses common issues and provides solutions for proprietary apps.

Demo app

Persistent connections

Plugins

Other features

Can I modify the source code of the demo app to create my own project?

Yes, you can. For more information, see the developer guide.

How do I replace the appkey in the demo app?

You can replace the security image to change the appkey. For more information, see the developer guide.

What is the minimum supported version for the Android SDK?

4.4.0

Why do persistent connections sometimes succeed and sometimes fail?

This issue can occur if the persistent connection channel SDK is initialized multiple times. This is often caused by multiple processes that initialize the SDK, which leads to repeated reconnections. To resolve this issue, you can implement a check to identify the main process and initialize the SDK only within that process, as shown in the demo app. The following code provides an example.

// Initialize other SDKs only in the main process.
String packageName = this.getPackageName();
if (!packageName.equals(ThreadTools.getProcessName(this, android.os.Process.myPid()))) {
return;
}

Do I need to log on before binding a persistent connection?

Yes, you do. A persistent connection is bound to an account, so you must log on first.

The log contains the error "connect-onFailure, exce=Incorrect username or password"

This error is usually caused by a mismatch between the environment and the cached device certificate (ProductKey, DeviceName, and DeviceSecret). Uninstall the application and try again.

Can I register multiple downlink listeners in one app?

You can have only one channel, but you can add multiple listeners. If you set multiple listeners, each listener receives the callback once.

The proprietary app does not respond when I call the configurable UI plugin

Confirm that the following configurations are complete.

  • The device is provisioned and bound.

  • A UI is selected for Panel Selection on the Interaction page of the product in the console.

  • The iotId parameter is passed when you call the plugin panel.

Does the automated scene plugin support editing scenes?

Yes, but only for scenes that you created. You cannot edit scenes that are shared by other users.

What messages are displayed in the device message history plugin?

The device message history plugin displays all messages for which Message Center and App Push are configured. You can find these settings by choosing Interaction > Alert Settings in the console. This includes messages that are individually blocked by the user.

After I upload a GIF image in the network provisioning guide in the console, the image appears blank in the app when opened with the provisioning plugin

Add the GIF support library to the SDK: compile 'com.facebook.fresco:animated-gif:0.11.0.

When I call the network provisioning plugin from a proprietary app on Android 8.0, the app cannot read the name of the connected Wi-Fi network, but it can on Android 6.0

Android 8.0 requires dynamic permission management, including location and Wi-Fi permissions.

When I open the network provisioning plugin from a proprietary app on iOS 12, the app cannot get the current Wi-Fi name (SSID)

For projects compiled with Xcode 10 for iOS 12.1, you must enable the required permission settings for the project.

After I bind a device in my proprietary app, the message "This route does not exist. Contact the support engineer to confirm." appears when I open the device panel

In the console, go to Interaction > UI Workbench. Edit, save, and publish the UI to your proprietary app.

Do the access and refresh URLs for third-party accounts support only HTTPS?

Yes, they do. HTTPS is required for security.

When I integrate a proprietary app with Tmall Genie, how do I configure the webhook address and what is it used for?

The webhook address must be a URL that starts with HTTP or HTTPS, and the domain name must include .com. For example, http://example.com.

When you redirect to a webview, you must add the webhook address. This address is validated against the address that is configured on the IoT Platform to ensure security.

One-click network provisioning works in my Android proprietary app that uses com.aliyun.alink.linksdk:ilop-devicecenter:1.3.0, but fails in version 1.6.5 and later

When you configure information for the device to be provisioned, do not set the deviceInfo.deviceName parameter for one-click provisioning. This causes an error in later versions of the SDK.

For devices shared in Preemptive or Shared mode, can the app call the /uc/shareDevicesAndScenes or /uc/generateShareQrCode operation to actively share the devices?

No, it cannot. These operations apply only when the sharing mode is Authorized.

Hot spot-based network provisioning fails in my Android proprietary app that uses the native provisioning method, and the log contains the error "SecurityException: UID 10465 has no location permission"

This security error occurs because the app requires location permissions. You must enable location permissions for the app.

How do I set the log level for or reduce the number of CoAP-related logs in my Android proprietary app?

You can set the log level using the following code: api('com.aliyun.alink.linksdk:coap-sdk:1.6.0@aar')AlcsCoAP.setLogLevelEx(com.aliyun.alink.linksdk.tools.ALog.LEVEL_ERROR);

The iOS network provisioning SDK cannot scan for devices, but the Android SDK can

The startDiscovery: method in iOS cannot find local Zigbee devices, but the same method works on Android.

If the Android device can scan for the Zigbee device but the iOS device cannot, the issue may be at the system level. You can download a third-party app, such as nRF Connect, on your iOS device to investigate. This can help determine if the operating system is filtering out the device.