okta / okta-idx-android

okta-idx-android
https://github.com/okta/okta-idx-android
Apache License 2.0
9 stars 13 forks source link

Cancel pollable as It does in Swift-IDX #176

Open GaniduAsh opened 1 year ago

GaniduAsh commented 1 year ago

Describe the feature request?

I am in the process of developing a Flutter plugin for Okta-idx which links to native kotlin SDK and swift SDK

Noticed there is no way to cancel polling behavior in android as it does in iOS SDK

what would be the ideal way to cancel polling behavior in android rather than using a Job as it does in sample app

New or Affected Resource(s)

com.okta.android:okta-idx-kotlin:2.1.0

Provide a documentation link

No response

Additional Information?

No response

rajdeepnanua-okta commented 1 year ago

Hi @GaniduAsh,

That's currently the ideal way to cancel polling. Polling is performed through a suspend function, which allows the users to cancel it. But, managing the scope that the suspend function runs in is the responsibility of the caller. iOS and Android concurrency models work slightly differently, so differences like these can come up.