Skip to content

Commit

Permalink
fix: iOS에서 기기 삭제 또는 공장 초기화 실패 시, response 안오는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
GwangrokBaek committed Dec 31, 2021
1 parent 182b273 commit 07046de
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions packages/iot-device-sdk/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,30 +354,30 @@ export class TuyaSdkBridge {
}

// 디바이스 삭제
// <iOS> 성공 - success 리턴, 실패 - 아무런 응답 없음. <android> 성공 - success 리턴, 실패 - [Error: device is removed] 리턴
public static async removeDevice(devId: TuyaNative.RemoveDeviceParams): Promise<boolean> {
let returnValue: boolean = false
const result = await TuyaNative.removeDevice(devId).catch((e) => {
console.log(e, "Error!")
})
if (result) {
console.log(result, "Success!")
returnValue = true
}
let returnValue: any = false
await TuyaNative.removeDevice(devId)
.then((result) => {
console.log(result, "Success!")
returnValue = true
})
.catch((e) => {
console.log(e, "Error!")
})
return returnValue
}

// 디바이스 공장초기화
// <iOS> 성공 - success 리턴, 실패 - 아무런 응답 없음. <android> 성공 - success 리턴, 실패 - [Error: device is removed] 리턴
public static async resetDevice(devId: TuyaNative.resetDeviceParams): Promise<boolean> {
let returnValue: boolean = false
const result = await TuyaNative.resetDevice(devId).catch((e) => {
console.log(e, "Error!")
})
if (result) {
console.log(result, "Success!")
returnValue = true
}
await TuyaNative.resetDevice(devId)
.then((result) => {
console.log(result, "Success!")
returnValue = true
})
.catch((e) => {
console.log(e, "Error!")
})
return returnValue
}

Expand Down

0 comments on commit 07046de

Please sign in to comment.