Smartling / ios-lqa-sdk

Smartling Mobile SDK for iOS (Mobile Context, In App Review, Mobile Delivery Network)
Other
3 stars 2 forks source link

Feature request: trigger context capture without gesture #5

Open michaelpetrov opened 7 years ago

michaelpetrov commented 7 years ago

I would like to be able to trigger the context capture without the long press gesture. When I integrated the framework into a more complex app (Dropbox) the long press gesture did not seem to be detected. It likely conflicts with the many other custom things that we have in the app when the UI gets constructed. I tried to debug it but got as far as manually calling sl_triggerActions: on the key window which did not seem to work.

Would it be possible to expose a method on the Smartling object to trigger context capture? I can then integrate it into our own UI and trigger it in a more reliable way.

Thanks in advance!

emilienh commented 7 years ago

Great idea Michael, I'm going to add this.

emilienh commented 7 years ago
[Smartling captureWindow:<UIWindow> withCompletion:^(NSError *error) {
    // Error handling
}];

Added in version 1.4.0. Please let me know if you have any questions.

michaelpetrov commented 7 years ago

Awesome! Will try it today and report back. Thank you for the super rapid response.

michaelpetrov commented 7 years ago

I'm making progress with the integration but running into this error from captureWindow::

2017-06-09 14:26:41.438 Dropbox[3441:557066] manually triggering capture
2017-06-09 14:26:41.568 Dropbox[3441:557066] [SL] Found string <SLString (No Offline Files) [(null)] [No Offline Files]> for localized string ​No Offline Files⁢
2017-06-09 14:26:41.569 Dropbox[3441:557066] [SL] Found string <SLString (Loading…) [(null)] [Loading…]> for localized string ​Loading…⁢
2017-06-09 14:26:41.569 Dropbox[3441:557066] [SL] Found string <SLString (Get to Your Files Offline) [(null)] [Get to Your Files Offline]> for localized string ​Get to Your Files Offline⁢
2017-06-09 14:26:41.571 Dropbox[3441:557066] [SL] Found string <SLString (Make your most important files available without an internet connection) [(null)] [Make your most important files available without an internet connection]> for localized string ​Make your most important files available without an internet connection⁢
2017-06-09 14:26:41.572 Dropbox[3441:557066] [SL] Found string <SLString (Show me how) [(null)] [Show me how]> for localized string ​Show me how⁢
2017-06-09 14:26:41.572 Dropbox[3441:557066] [SL] Found string <SLString (Offline) [(null)] [Offline]> for localized string ​Offline⁢
2017-06-09 14:26:41.573 Dropbox[3441:557066] [SL] Found string <SLString (Recents) [(null)] [Recents]> for localized string ​Recents⁢
2017-06-09 14:26:41.573 Dropbox[3441:557066] [SL] Found string <SLString (Add File) [(null)] [Add File]> for localized string ​Add File⁢
2017-06-09 14:26:41.574 Dropbox[3441:557066] [SL] Found string <SLString (Photos) [(null)] [Photos]> for localized string ​Photos⁢
2017-06-09 14:26:41.574 Dropbox[3441:557066] [SL] Found string <SLString (Offline) [(null)] [Offline]> for localized string ​Offline⁢
2017-06-09 14:26:41.575 Dropbox[3441:557066] [SL] Found string <SLString (Files) [(null)] [Files]> for localized string ​Files⁢
2017-06-09 14:26:41.576 Dropbox[3441:557066] [SL] Took screenshot with strings (
    "<SLScreenshotString No Offline Files {{0, 64}, {320, 64}}>",
    "<SLScreenshotString Loading\U2026 {{135.5, 92}, {74.5, 20.5}}>",
    "<SLScreenshotString Get to Your Files Offline {{30, 278}, {260, 20.5}}>",
    "<SLScreenshotString Make your most important files available without an internet connection {{30, 303.5}, {260, 60}}>",
    "<SLScreenshotString Show me how {{112.5, 394.5}, {95.5, 20}}>",
    "<SLScreenshotString Offline {{134, 32}, {52.5, 20.5}}>",
    "<SLScreenshotString Recents {{12.5, 164}, {39, 12}}>",
    "<SLScreenshotString Add File {{140.5, 1164}, {39, 12}}>",
    "<SLScreenshotString Photos {{207, 164}, {34, 12}}>",
    "<SLScreenshotString Offline {{271.5, 164}, {32.5, 12}}>",
    "<SLScreenshotString Files {{84.5, 164}, {22.5, 12}}>"
)
2017-06-09 14:26:41.576 Dropbox[3441:557066] [SL] Tracked event Context Capture
2017-06-09 14:26:41.576 Dropbox[3441:557066] Smartling captureWindow completion: Error Domain=com.smartling.SDK Code=500 "No string UIDs provided" UserInfo={NSLocalizedDescription=No string UIDs provided}

I think it's having trouble matching up strings somewhere. Any pointers for debugging this further? Thanks!

emilienh commented 7 years ago

Hi Michael, in Context Capture mode the SDK tries to download strings when the app starts, that's where it gets these UIDs it's telling you about. What are you seeing in the logs at launch? Is there an error while downloading strings?

emilienh commented 7 years ago

@michaelpetrov any updates on this issue?