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

fix: send native to flutter messages on main thread #134

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

levibostian
Copy link
Contributor

@levibostian levibostian commented Jul 30, 2024

Ticket: https://linear.app/customerio/issue/MBL-358/

When the native iOS in-app module communicates with the Flutter SDK, it currently does so on the native background thread. According to flutter docs, it should be the main thread.

Testing

  • In Flutter sample app, do things that would make the in-app global event listener to trigger. Before this bug fix, you should see error show up in Xcode console. After the bug fix, you should no longer see the error.
  • I searched the Flutter source code where everywhere that invokeMethodInBackground is called to see if there were any other places where we could be having native code communicate to Flutter SDK and I only found the 1 place that I modified.

@levibostian levibostian requested a review from a team July 30, 2024 17:58
Copy link
Contributor

@mrehan27 mrehan27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍🏻

@levibostian levibostian changed the base branch from levi/get-sample-app-compiling to main July 31, 2024 18:46
@levibostian levibostian force-pushed the levi/customer_io-channel-non-native-thread branch from 6eff940 to e303c42 Compare July 31, 2024 18:47
@levibostian levibostian merged commit bc8704b into main Aug 1, 2024
4 checks passed
@levibostian levibostian deleted the levi/customer_io-channel-non-native-thread branch August 1, 2024 17:32
github-actions bot pushed a commit that referenced this pull request Aug 1, 2024
## [1.5.1](1.5.0...1.5.1) (2024-08-01)

### Bug Fixes

* send native to flutter messages on main thread ([#134](#134)) ([bc8704b](bc8704b))
github-actions bot pushed a commit to AristideVB/customerio-flutter that referenced this pull request Oct 12, 2024
## 1.0.0 (2024-10-12)

### Features

* added missing methods ([customerio#17](https://github.com/AristideVB/customerio-flutter/issues/17)) ([73f29e6](73f29e6))
* added SDK config  ([customerio#1](https://github.com/AristideVB/customerio-flutter/issues/1)) ([e8ed7dd](e8ed7dd))
* do not show modal message if screen changes and page rule mismatches ([customerio#131](https://github.com/AristideVB/customerio-flutter/issues/131)) ([a563055](a563055))
* in-app dismiss support ([customerio#51](https://github.com/AristideVB/customerio-flutter/issues/51)) ([c4d21f2](c4d21f2))
* in-app message persistence ([customerio#97](https://github.com/AristideVB/customerio-flutter/issues/97)) ([71d85cc](71d85cc))
* process push notifications received outside CIO SDK ([customerio#38](https://github.com/AristideVB/customerio-flutter/issues/38)) ([7b5cb7e](7b5cb7e))
* support for android gradle plugin 8 ([customerio#117](https://github.com/AristideVB/customerio-flutter/issues/117)) ([48b4e06](48b4e06))
* tracking and in-app added ([customerio#2](https://github.com/AristideVB/customerio-flutter/issues/2)) ([c23f2d9](c23f2d9))

### Bug Fixes

* add test coverage and refactored scripts ([customerio#34](https://github.com/AristideVB/customerio-flutter/issues/34)) ([f7f2387](f7f2387))
* added proguard rules for R8 strict mode ([customerio#116](https://github.com/AristideVB/customerio-flutter/issues/116)) ([9946fe7](9946fe7))
* autoupdate to latest major version of iOS SDK ([customerio#40](https://github.com/AristideVB/customerio-flutter/issues/40)) ([974a342](974a342))
* formatting issues ([d67fa7e](d67fa7e))
* hardcode android native SDK version ([customerio#61](https://github.com/AristideVB/customerio-flutter/issues/61)) ([587f559](587f559))
* improve android push click behavior ([customerio#89](https://github.com/AristideVB/customerio-flutter/issues/89)) ([62b9e61](62b9e61))
* improve in-app logs ([customerio#139](https://github.com/AristideVB/customerio-flutter/issues/139)) ([b10cc75](b10cc75))
* in-app concurrency issue android ([customerio#73](https://github.com/AristideVB/customerio-flutter/issues/73)) ([93332a4](93332a4))
* in-app crash for no browser ([customerio#94](https://github.com/AristideVB/customerio-flutter/issues/94)) ([8b859ed](8b859ed))
* in-app messages not displaying for release builds on Android ([customerio#65](https://github.com/AristideVB/customerio-flutter/issues/65)) ([1d742c2](1d742c2))
* in-app remove gist org id ([customerio#19](https://github.com/AristideVB/customerio-flutter/issues/19)) ([ce4cc9e](ce4cc9e))
* iOS crash on forced unwrapping  ([customerio#59](https://github.com/AristideVB/customerio-flutter/issues/59)) ([f514174](f514174))
* missing methods and extra dependency ([2c5deca](2c5deca))
* missing opened metric on android 12 and above ([customerio#43](https://github.com/AristideVB/customerio-flutter/issues/43)) ([1a61e0e](1a61e0e))
* obj-c bindings issue ([0dbe4ef](0dbe4ef))
* plugin version in user-agent ([a10e482](a10e482))
* release script typo ([2a8b7ae](2a8b7ae))
* send native to flutter messages on main thread ([customerio#134](https://github.com/AristideVB/customerio-flutter/issues/134)) ([bc8704b](bc8704b))
* stack-overflow caused by BQ recursion ([customerio#90](https://github.com/AristideVB/customerio-flutter/issues/90)) ([ebc7511](ebc7511))
* typo fixed ([customerio#9](https://github.com/AristideVB/customerio-flutter/issues/9)) ([a5107df](a5107df)), closes [customerio#7](https://github.com/AristideVB/customerio-flutter/issues/7) [customerio#8](https://github.com/AristideVB/customerio-flutter/issues/8)
* updated android dependency to auto update ([customerio#24](https://github.com/AristideVB/customerio-flutter/issues/24)) ([040cef2](040cef2))
* updated icon and typo ([57c6eef](57c6eef))
* updated module name from common to CioInternalCommon ([customerio#55](https://github.com/AristideVB/customerio-flutter/issues/55)) ([d81f8df](d81f8df))
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

Successfully merging this pull request may close these issues.

2 participants