Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Platform Error #9

Open
vishal-iosdeveloper opened this issue Sep 30, 2023 · 1 comment
Open

Uncaught Platform Error #9

vishal-iosdeveloper opened this issue Sep 30, 2023 · 1 comment

Comments

@vishal-iosdeveloper
Copy link

vishal-iosdeveloper commented Sep 30, 2023

In my flutter project, I am following this document from Terra.
authenticate-widget

Here for Apple health, I have followed this : unified-api-manage-integrations-flutter

I have below terra package version in my project -
terra_flutter_bridge: ^0.4.8

static void initialiseTerraSDK() async {
  print("=================== initialiseTerraSDK ===================");
  SuccessMessage message = await TerraFlutter.initTerra(
      TERRA_DEV_ID, store.state.patientState.selectedPatient.cura_code);
  print("======= TERRA SuccessMessage initialiseTerraSDK=======");
  print(message.error);
  print(message.success);
}

static void initTerraConnection() async {
  print("=================== initTerraConnection ===================");
  SuccessMessage message = await TerraFlutter.initConnection(
      Connection.appleHealth,
      "some_token",
      true, []);

  print("======= TERRA SuccessMessage initTerraConnection =======");
  print(message.error);
  print(message.success);
}

static Future<UserId> checkTerraConnection() async {
  print("=================== checkTerraConnection ===================");
  UserId user_id = await TerraFlutter.getUserId(Connection.appleHealth);
  print("======= TERRA USERID =======");
  print(user_id.success);
  print(user_id.userId);
  return user_id;
}

Here I am able to initialiseTerraSDK in code base.
But when I try to connect it with Apple health OR checkTerraConnection,
It's giving me below error.

[error] Uncaught Platform Error
                       PlatformException(error, could not initialise connection, null, null)
                       #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
                       #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
                       <asynchronous suspension>
                       #2      TerraFlutter.initConnection (package:terra_flutter_bridge/terra_flutter_bridge.dart:226:62)
                       <asynchronous suspension>


[error] Uncaught Platform Error
                       PlatformException(Connection Type Error, Could not call getter for type: body. make sure you are passing a valid iOS connection ...
                       #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
                       #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
                       <asynchronous suspension>
                       #2      TerraFlutter.getUserId (package:terra_flutter_bridge/terra_flutter_bridge.dart:236:54)
                       <asynchronous suspension>

Any idea guys ?

@crefter
Copy link

crefter commented Mar 27, 2024

Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants