FAQ

Last Updated on : 2023-05-22 06:38:30download

Why is the navigation bar style of other view controllers changed after the push method is called to navigate to the panel?

Device Control UI BizBundle is designed to provide a view controller that loads a rendered React Native page. During this process, this view controller hides the navigation bar by modifying the transparency.

Therefore, after the push method is called to access the panel controller, when you pop back to the controller, the style will be restored. This is because the push and pop animations for iOS are managed by NavigationController. Only one NavigationBar is used. On the Stack storage structure of NavigationController, when the navigation bar of a ViewController on Stack is modified, the style of other ViewControllers is modified accordingly.

You can use any of the following two methods to restore the style:

  • Method 1:

    // 1. Import the header file.
    #import <TYNavigationController/TYNavigationTopBarProtocol.h>
    // 2. Display the navigation bar.
    self.ty_topBarHidden = NO;
    self.ty_topBarAlpha = 1.0;
    // 3. Restore the style of the navigation bar. For example, modify the background color.
    self.ty_topBarBackgroundImage = <#Image#>;
    // Or
    self.ty_topBarBackgroundColor = <#Color#>;
    
  • Method 2:

    // 1. Import the header file.
    #import <TYNavigationController/TYNavigationCallbackProtocol.h>
    // 2. Implement the delegate method of `TYNavigationCallbackProtocol`.
    - (void)ty_naviTransitioning:(id<UIViewControllerTransitionCoordinatorContext>)context {
        // 3. Display the navigation bar.
        [self.navigationController setNavigationBarHidden:false animated:true];
        // 4. Restore the style of the navigation bar. For example, modify the background color.
        [self.navigationController.navigationBar setBarTintColor:<#Color#>];
        // Or
        [self.navigationController.navigationBar setBackgroundImage:<#Image#> forBarMetrics:UIBarMetricsDefault];
    }
    

Why does pod update returns an error message during the process to load dependent plug-ins?

CocoaPods can be used to integrate with the UI BizBundle. In this case, due to the logic of the pod, when the version of each pod library is not specified in the Podfile, the latest official version number will be integrated by default. The version format is x.y.z, where x, y, and z are numbers.

To depend on the extension features as the plug-ins provided by the Device Control UI BizBundle, you must set the baseline version number denoted by the latest date of the UI BizBundle in the Podfile. This is because the versions of the plug-ins are the pre-release versions. For more information about the version history of the UI BizBundle, see Version History.

Why does the system returns the error message “The current version is unavailable. Please update the app” after navigation to the panel?

Before the API request is made to access the Device Details UI BizBundle, the device information must be queried with the following API method of Smart Life App SDK:

/**
 *  After init home, need to get home details
 *  Returns the details of a specific home after the home object is initialized. This way, the home instance object can have data respecting the properties `homeModel`, `roomList`, `deviceList`, and `groupList`.
 *
 *  @param success     Success block
 *  @param failure     Failure block
 */
- (void)getHomeDetailWithSuccess:(void (^)(TuyaSmartHomeModel *homeModel))success
                         failure:(TYFailureError)failure;

If the error message still appears in follow-up operations, the causes might be that:

  • The Message Queuing Telemetry Transport (MQTT) communication protocol supported by the current SDK is earlier than the firmware communication protocol. This means that deviceModel.pv is earlier than TUYA_CURRENT_GW_PROTOCOL_VERSION.
  • The current local area network (LAN) communication protocol supported by the SDK is earlier than the firmware communication protocol. This means that deviceModel.lpv is earlier than TUYA_CURRENT_LAN_PROTOCOL_VERSION.
  • The Panel Multilingual BizBundle does not support the current version. This means that deviceModel.rnFind is false.
  • No suitable view controller has been found by the panel.