getphyllo / phyllo-connect-flutter

MIT License
1 stars 4 forks source link

Bugfix/result resolve #6

Closed 100lvlmaster closed 2 years ago

100lvlmaster commented 2 years ago

Problem: User cannot await the phyllo sdk initialization beacuse the result of platform channel is not resolved. i.e

result.success()
// or 
result.error()

I've added below code snippet so that we can wait and observe phyllo sdk status.

        userId: String,
        token: String,
        environment: String,
-        workPlatformId: String
+        workPlatformId: String,
+       @NonNull result: Result
    ) {

        Log.d(logTag, "Initialize Phyllo Connect Sdk")
class PhylloConnectPlugin : FlutterPlugin, MethodCallHandler {

                override fun onExit() {
                    Log.d(logTag, "onExit")
+                    result.success("Closed phyllo sdk")
                }
            })

    }
    private fun open(){
        PhylloConnect.startSDK()
    }
}