on 12-03-2021 4:49 AM
Hello,
I'm trying to open image in offline mdk app, but the app is just closing whenever 'Download Media' action is being executed on iOS. But, it is working well on Android. I checked 'ClientLog.txt' file on device, but no error message is found. The image is already downloaded in offline store when offline is initialized.
Program is crashing below with DownloadImage.action(before Success Action - DocumentFileSave.js ) .
} else if (mediaIsLocal) {
return pageProxy.executeAction("/WOOffline/Actions/DownloadImage.action");
} else {
Please find attached related source files.
Version: MDK: 6.1.0
iOS: 15.1 (tested with old version 14.8.1, but it is the same).
Since it is working well in Android and no error message is found in log file, I don't know how I can check further. Any guide would be very appreciated.
Thanks.
While I don't have a solution at this time and agree it should not crash, as an alternative, did you know that MDK 6.1 supports direct OData image rendering? Instead of calling Download and saving the image to the local device you can just directly reference the image to simplify the process.
See the What's New in Mobile Development Kit client 6.1 blog for more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I changed the code like below as you suggested with direct reference.
} else if (mediaIsLocal) {
//return pageProxy.executeAction("/WOOffline/Actions/DownloadImage.action");
let path = "/WOOffline/Services/WorkOrder.service/" + readLink + "/$value";
alert(path);
return pageProxy.executeAction({
"Name": "/WOOffline/Actions/OpenImage.action",
"Path": path,
"MimeType": "image/jpeg"
})
}
The variable 'path' shows like below and looks fine with alert function:
/WOOffline/Services/WorkOrder.service/ZWOAttachmentSet(Aufnr='4100003',FileName='4100003_20211202_101806_00033')/$value
It is not crashing, but not opening image and getting this error message below:
#2021-12-03 10:45:15:792 -0500: ERROR - (Main) - SAP.MDKClient - SharedLogger.swift.log(_:message:) - download OfflineOData error: Error: [-10133] A defining query with name "ZWorkOrderSet('4100003')" does not exist
I'm not sure why I'm getting this error message.
Here is the Object Table target definition on page:
"_Type": "Section.Type.ObjectTable",
"DataSubscriptions": [
"ZWOAttachmentSet"
],
"Target": {
"Service": "/WOOffline/Services/WorkOrder.service",
"EntitySet": "{@odata.readLink}/OrderAttach",
"QueryOptions": "$orderby=FileName",
"ReadLink": ""
},
Thanks.
I was actually referring to the direct image rendering support where you just directly reference the OData image in the DetailImage property. If the media is already downloaded during initialization then no rules are required. Just point to the image.
"ObjectCell": {
"Title": "{Name}",
"Subhead": "{CategoryName}",
"Footnote": "{DimensionWidth} {DimensionUnit} x {DimensionHeight} {DimensionUnit} x {DimensionDepth} {DimensionUnit}",
"StatusText": "$(C,{Price},{CurrencyCode},'',{minimumIntegerDigits:1,minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:true})",
"SubstatusText": "{QuantityUnit}",
"DetailImage": "/PersistentFilters/Services/SampleServiceV2.service/{@odata.readLink}/$value",
"DetailImageIsCircular": false,
"PreserveIconStackSpacing": false,
"AccessoryType": "disclosureIndicator",
"OnPress": "/PersistentFilters/Actions/Products/NavToProducts_Detail.action"
},
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.