smartlook / smartlook-mobile-issue-tracker

Official Smartlook issue tracker for mobile SDKs
4 stars 0 forks source link

Smartlook for Flutter Future methods never resolve #116

Closed savy-91 closed 2 years ago

savy-91 commented 2 years ago

Platform Android

Technology Flutter 2.5.1

Smartlook SDK version 3.0.3

Summary The async methods used to start recording, reset session never resolve. Because the return type of the methods is Future<void> as a developer I expect to be able to await the method calls.

Steps to reproduce [optional] The following code:

  Future<void> recordScreen() async {
    print('Start');
    final SetupOptions options =
        SetupOptionsBuilder('API_KEY').build();
    print('Setup');
    Smartlook.setup(options);
    print('Reset');
    await Smartlook.resetSession(true);
    print('StartRecording');
    await Smartlook.startRecording();
    print('SetRenderingMode');
    await Smartlook.setRenderingMode(SmartlookRenderingMode.wireframe);
    print('SetUserIdentifier');
    await Smartlook.setUserIdentifier('TEST00');
    print('GetDashboardSessionUrl');
    final String? url = await Smartlook.getDashboardSessionUrl(true);
    print('Dashboard session url $url');
  }

Only outputs (no error is thrown):

I/flutter (28227): Start
I/flutter (28227): Setup
I/flutter (28227): Reset

The following code:

  Future<void> recordScreen() async {
    print('Start');
    final SetupOptions options =
        SetupOptionsBuilder('API_KEY').build();
    print('Setup');
    Smartlook.setup(options);
    print('StartRecording');
    await Smartlook.startRecording();
    print('SetRenderingMode');
    await Smartlook.setRenderingMode(SmartlookRenderingMode.wireframe);
    print('SetUserIdentifier');
    await Smartlook.setUserIdentifier('TEST00');
    print('GetDashboardSessionUrl');
    final String? url = await Smartlook.getDashboardSessionUrl(true);
    print('Dashboard session url $url');
  }

Only outputs:

I/flutter (28227): Start
I/flutter (28227): Setup
I/flutter (28227): StartRecording
krystofcelba commented 2 years ago

Hey, Thanks for your issue report. I just want to ask if there is issue with functionality as well or if is it only with the Future return type? Of course that what you say make sense and we'll look on it.

savy-91 commented 2 years ago

I think so.

It works well for native rendering, I have been having issues with Wireframe rendering yesterday but I haven't investigated as much as I'd like to before opening an issue here.

I'll come back on monday with a definitive answer :)