go-acoustic / SDK_Tools

SDK tools that are used for UIC, iOS or Android for Tealeaf
9 stars 18 forks source link

logImage deprecated #1

Closed Marcoc88 closed 4 years ago

Marcoc88 commented 4 years ago

Our team is upgrading our Tealeaf iOS SDK from version: 9.0.1.7 to the current Tealeaf SDK version: 10.5.5. We use - (BOOL)logImage:(UIImage *)image; which has been deprecated and removed from TLFCustomEvent.h. Can you please tell me the new method that should be used now that logImage has been removed?

sdamale commented 4 years ago

@Marcoc88 If you are taking a screenshot, please use TLFCustomEvent's logPrintScreenEvent. If you are logging a custom image, I will discuss with the team and expose the API again in the upcoming release.

Marcoc88 commented 4 years ago

@sdamale Thank you for the quick response! While the logPrintScreenEvent method works well, in our use case we want to capture the print screen but we have screens with UIScrollViews (vertical) and want to capture the entire height of the UIScrollView. In the past we implemented custom logic to grab the Graphics Context, cut that up into Window height segments, then create Images of the UIScrollView Graphics Context sized for the Window height, like pages. We then use logImage for this custom image that is created.

It would be great if we could have an API to be able to capture these custom images. Is there an estimated date for the upcoming release that could have this change?

sdamale commented 4 years ago

@Marcoc88 Thanks for the details on the requirement. There isn't a date yet. But I expect later this month/early June.

Marcoc88 commented 4 years ago

@sdamale Thank you!

fejimene commented 4 years ago

Hi @sdamale, any plans to release this functionality soon? My team also has the need to send a custom image to the tealeaf target endpoint.

sdamale commented 4 years ago

Hi @fejimene

Yes I have added the API back in the latest release. Its called logLayoutWithImage.

Release notes : https://github.com/ibm-watson-cxa/SDK_Tools/blob/master/SDKPackages/tealeaf/ios/Release%20Notes.txt

API is documented here : https://developer.goacoustic.com/acoustic-exp-analytics/docs/custom-instrumentation-for-ios

sdamale commented 4 years ago

@Marcoc88 FYI.

fejimene commented 4 years ago

Hi @fejimene

Yes I have added the API back in the latest release. Its called logLayoutWithImage.

Release notes : https://github.com/ibm-watson-cxa/SDK_Tools/blob/master/SDKPackages/tealeaf/ios/Release%20Notes.txt

API is documented here : https://developer.goacoustic.com/acoustic-exp-analytics/docs/custom-instrumentation-for-ios

@sdamale Thanks so much for you reply, quick question related to logScreenLayoutWithImage, is there a setting to log only the image with no layout info wrapped around?

sdamale commented 4 years ago

@fejimene There isn't. It has to be a type 10 layout message. Thats what replay supports. If you are worried about entire screen layout is getting captured, then, no that is not the case. Only actual image that you pass in as a parameter is logged inside a message that looks like a type 10 layout message.

Please refer to a commented out example here : https://github.com/ibm-watson-cxa/WCXA-SampleApp-iOS/blob/master/CXA/SearchViewController.m inside function - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText

You can pass-in whatever image you want to to this API.

Here is how the actual payload looks like ..

{
  "sessions": [
    {
      "message": {
        "layout": {
          "name": "SearchViewController",
          "class": "",
          "controls": [
            {
              "zIndex": 500,
              "subType": "UIView",
              "tlType": "image",
              "id": "140694895785056",
              "position": {
                "y": 0,
                "x": 0,
                "width": 414,
                "height": 896
              },
              "idType": -3,
              "image": {
                "height": 1316,
                "value": "B4EB370BCC26F01DBD95B6B4355BE5FE297DCD353946EA101A081B90D32F3BBE",
                "mimeExtension": "png",
                "type": "image",
                "base64Image": "iVBORw ....... ",
                "width": 2252
              },
              "cssId": "140694895785056",
              "type": "UIImageView"
            }
          ]
        },
        "offset": 10230,
        "fromWeb": false,
        "screenviewOffset": 4191,
        "count": 14,
        "deviceHeight": 896,
        "version": "1.0",
        "type": 10,
        "orientation": 0,
        "deviceWidth": 414
      }
    }
  ]
}

As you can see there is no layout in there, just the base64 of the image.