feat(rum): support remote configuration in Flutter - #19
Conversation
|
小程序端的pr在 flashcatcloud/fc-sdk-wechat-miniprogram#18 ,里边几个方法可以参考里边的说明 |
|
|
||
| internal fun beforeSampling(context: BeforeSamplingContext): Float? { | ||
| val encodedContext = try { | ||
| Gson().toJson( |
There was a problem hiding this comment.
[P2] Preserve explicit null values in the beforeSampling context
The default Gson encoder omits object entries whose value is null, including nested entries. For example, custom = {"override": null} reaches the Dart callback as {}, while getRemoteConfig() and the iOS bridge preserve that entry. A sampling callback that uses containsKey to distinguish an absent setting from an explicitly cleared setting can therefore make a different decision on Android.
Please use GsonBuilder().serializeNulls().create() here and add coverage for both top-level and nested null-valued custom entries. Reproduced with Gson 2.12.1: the current encoder drops those entries, while a serializeNulls() control preserves them.


支持配置动态下发

ios 模拟器测试了 远程配置下发,beforeSampling和getRemoteConfig