Last Updated on : 2024-06-12 10:22:48download
This topic describes how to manage user accounts.
Type | Meaning |
---|---|
Brand owner account | Users cannot create this type of account. The account that you receive upon purchasing the OEM SaaS. It is associated with your OEM SaaS domain. |
Enterprise main account | The account that you create on your own. It has all privileges within the organization and can create or delete projects. |
Enterprise sub-account | The account that an enterprise main account creates in their SaaS. It is granted access to specific features. |
Creating a main account on the mobile app is not supported. Go to the Smart Commercial Lighting platform to create an account.
The account system is designed with the one-to-many model, with one account assigned to multiple merchants. In the commercial lighting scenario, the system is limited to the one-to-one relationship, with one account uniquely assigned to one merchant. There is no need to specify the merchant code for login, because the system can retrieve the unique merchant associated with the current account.
Supported login methods:
Log in with a third-party account: Implemented in tandem with the Commercial Lighting OpenAPI.
Procedure
Scenario
lighting.console.tuyacn.com?ticket=xxx
For example, redirect users to the system website or an H5 page for device control.API description
- (void)loginMerchantByTicket:(nonnull NSString *)ticket
multiMerchantHanlder:(void(^_Nullable)(NSArray<ThingSmartMerchantModel *> * _Nonnull merchantInfos))multiMerchantHanlder
success:(nullable ThingSuccessHandler)success
failure:(nullable ThingFailureError)failure;
Parameters
Parameter | Description |
---|---|
ticket | The ticket obtained during the authorization process. |
Sample code
[ThingSmartUser.sharedInstance loginMerchantByTicket:@"" multiMerchantHanlder:^(NSArray<ThingSmartMerchantModel *> * _Nonnull merchantInfos) {
} success:^{
} failure:^(NSError *error) {
}];
Recover or reset the password if users forget it. The steps for both operations are identical. Permission is verified before the request for the list of merchants. Follow these steps:
For more information, see Recover/Reset password.
The SDK manages the storage and deletion of account information, freeing you from taking care of its security and synchronization.
After successful login, the SDK will store the account information in the cache. After users log out, the SDK will clear the cache. You can handle your business logic after a successful callback.
For more information, see Log out.
To delete an enterprise main account, submit a service ticket for manual review.
Currently, the merchant account system does not support binding an account with a phone number or email address.
After a successful login, the account name and role will be returned as the account properties. To get additional properties such as nickname and avatar, invoke the getMerchantUserInfoWithSuccess: failure: method.
The getMerchantUserInfoWithSuccess: failure: method can also be used to sync additional user information between apps.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback