diff --git a/plugin.xml b/plugin.xml index c4df11d..ce93f33 100644 --- a/plugin.xml +++ b/plugin.xml @@ -4,7 +4,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"> cordova-plugin-roomplan - + diff --git a/src/ios/CDVRoomPlan.swift b/src/ios/CDVRoomPlan.swift index ddd7cd0..693da1d 100644 --- a/src/ios/CDVRoomPlan.swift +++ b/src/ios/CDVRoomPlan.swift @@ -113,16 +113,16 @@ class CDVRoomPlan: CDVPlugin, RoomCaptureSessionDelegate, RoomCaptureViewDelegat func exportResults() { let documentsDirectory = FileManager.default.temporaryDirectory.appendingPathComponent("cordova-room-plan") let uuid = NSUUID().uuidString - let usdzFile = documentsDirectory.appendingPathComponent(uuid + ".usdz") + let modelFile = documentsDirectory.appendingPathComponent(uuid + ".usdz") let jsonFile = documentsDirectory.appendingPathComponent(uuid + ".json") do { try FileManager.default.createDirectory(at: documentsDirectory, withIntermediateDirectories: true, attributes: nil) let jsonEncoder = JSONEncoder() let jsonData = try jsonEncoder.encode(self.processedResult) try jsonData.write(to: jsonFile) - try self.processedResult?.export(to: usdzFile, exportOptions: .parametric) + try self.processedResult?.export(to: modelFile, exportOptions: .parametric) if (self.processedResult != nil) && isCapturedRoomNil(capturedRoom: self.processedResult!) { - let result = ["usdz": usdzFile.absoluteString, "json": jsonFile.absoluteString, "message": "Scanning completed successfully"] + let result = ["model": modelFile.absoluteString, "json": jsonFile.absoluteString, "message": "Scanning completed successfully"] let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: result) pluginResult?.keepCallback = true self.commandDelegate.send(pluginResult, callbackId: self.command.callbackId)