Search Unity

Question 1 solved! Question 2 on TakeScreenshotFromSource

Discussion in 'Unity Cloud Diagnostics' started by Phantomsom, Feb 26, 2019.

  1. Phantomsom

    Phantomsom

    Joined:
    Oct 21, 2017
    Posts:
    4
    [EDIT, #Question 1 is solved! read the reply below to find out where it's stored.]
    Hello everyone, hope everyone here is doing well. I'm working on a stealth bug reporting system and I want to store UserReports in users devices. I found this function on the documentation that suggests that it can do what I want b̶u̶t̶,̶ ̶f̶o̶r̶ ̶m̶y̶ ̶f̶i̶r̶s̶t̶ ̶q̶u̶e̶s̶t̶i̶o̶n̶,̶ ̶W̶h̶e̶r̶e̶ ̶e̶x̶a̶c̶t̶l̶y̶ ̶i̶n̶ ̶d̶i̶s̶k̶ ̶i̶s̶ ̶t̶h̶e̶ ̶u̶s̶e̶r̶ ̶r̶e̶p̶o̶r̶t̶s̶ ̶s̶t̶o̶r̶e̶d̶?̶

    upload_2019-2-26_18-31-30.png

    The second question (now one and only question) is why can't I pass in a UserReportScreenshot object with assigned variables as a parameter for the third parameter in the "TakeScreenshotFromSource()" function. I tried doing that. Upon inspecting the callback, the screenshot that is returned is the current screen's capture. Does that mean I can only pass in a camera, and a render texture to get the right screenshot from callback?

    upload_2019-2-27_10-55-42.png

    So desired result : Gets screenshot on unity cloud diagnostics that is saved from a previous session (From saving past user reports)

    Current undesired result : Gets current screenshot on unity cloud diagnostics, that is obtained from current session. (We want screenshot from previously stored session, so we serialized the screenshot's data in Database64(string) and pushed it into the TakeScreenshotFromSource function), but produced undesired results.

    upload_2019-2-26_18-41-20.png


    else if (_existingBugDetected)
    {
    UserReportScreenshot mainScreenshotOnDisk = new UserReportScreenshot();
    mainScreenshotOnDisk.DataBase64 = bugReportStorageEntryOnDisk.mainScreenshotDataBase64;
    mainScreenshotOnDisk.DataIdentifier = bugReportStorageEntryOnDisk.mainScreenshotDataIdentifier;
    mainScreenshotOnDisk.FrameNumber = bugReportStorageEntryOnDisk.mainScreenshotFrameNumber;
    UnityUserReporting.CurrentClient.TakeScreenshotFromSource(MAX_WIDTH_MAINSC, MAX_HEIGHT_MAINSC, mainScreenshotOnDisk, ReturnSerializedScreenshot);
    }


    [Used for giving context on question #2], and my current implementation that produced the above undesired results (refer to screenshot with screenshots in it[lmao])
    The code description (from the top to bottom) is :
    1) if, an existing bug on the device is found

    2) create an empty UserReportScreenshot object
    (So that I can pass it in into the "TakeScreenshotFromSource" function on the third parameter) [type object, used as the source of screenshot data]

    3) I assign the DataBase64 (One of the variables found inside the UserReportScreenshot) string variable with the string variable from a bugReportStorage class (thus the name "bugReportStorageEntryOnDisk), spawned from serializing a json string found on the device. (This json string is generated from generating a bug report on the device)

    [To those that don't know, the DataBase64 variable is a string, that contains screenshot information. After decoding it with a Base64 to Image converter, you'll get an image]

    Try it with this base64 string on this website!
    - edit - , okay nevermind the base 64 string is too long for this post. Do click on the link below and click on sample to see a bunch of random alphabets piece together from a screenshot!

    https://codebeautify.org/base64-to-image-converter
    Reference (Documentation) :
    (In order, the first link is for the first question's documentation screenshot, the second link is for the second question's documentation sceenshot)
    https://unitytech.github.io/clouddi...tToDisk_Unity_Cloud_UserReporting_UserReport_

    https://unitytech.github.io/clouddi...UserReporting.Client.UserReportingClient.html

    Thanks in advance for the help!
     

    Attached Files:

    Last edited: Feb 27, 2019
  2. Phantomsom

    Phantomsom

    Joined:
    Oct 21, 2017
    Posts:
    4
    EDIT, for #Question 1 it's solved. Apparently my SourceTree(Version control) software detected a new file change and from there I found out where it's stored. It's stored directly in the first page you see when you open your project folder.