Skip to content

Exception thrown regarding unimplemented unity#createPlayer method on iOS #708

Open
@behnamsattar

Description

@behnamsattar

Describe the bug
Upon calling the .create() method on the controller, I always get an exception saying it's not implemented. It seems to work, though.

To Reproduce
Here is my code to perform an unload and then recreate.

bool _isCheckingLoadState = false;

Future<void> _reloadUnityScene() async {
    await _unityWidgetController?.unload();
    timer = Timer.periodic(
      const Duration(milliseconds: 500),
      (_) async {
        if (!_isCheckingLoadState) {
          _isCheckingLoadState = true;
          final isLoaded = await _unityWidgetController?.isLoaded() ?? false;
          if (!isLoaded) {
            timer?.cancel();
            await _unityWidgetController?.create();
          }
          _isCheckingLoadState = false;
        }
      },
    );
  }

Expected behavior
The method call should not throw the unimplemented error, as this method is supposed to be working on iOS builds.

Unity (please complete the following information):

  • OS: macOS
  • Version: 12.6

Smartphone (please complete the following information):

  • Device: iPhone 11
  • OS: iOS
  • Version: 16.1

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue refers to a bug in the pluginiosThis issue is specific to the iOS/iPadOS Platform.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions