chat-sdk / chat-sdk-ios

Chat SDK iOS - Open Source Mobile Messenger
http://sdk.chat
Other
913 stars 276 forks source link

BChatSDK.hook().add crash #476

Closed N0t2Day closed 3 years ago

N0t2Day commented 3 years ago
  1. Is the bug present in the demo Chat SDK project? Can't download demo project cz error 404 on link.
  2. What modifications have you made to the Chat SDK? Crash inside CharSDK pod
  3. iOS Version? Device or simulator? iOS 14.6
  4. Steps taken to reproduce the problem: Снимок экрана 2021-06-11 в 09 41 24

Just run

  1. Expected result: Crash on add hook
    public override init() {
        super.init()
        BChatSDK.hook().add(BHook.init(_: { [weak self] dict in
            if let id = dict?[bHook_StringId] as? String, let value = dict?[bHook_ObjectValue] {
                if let boolValue = value as? Bool {
                    self?.setValue(bool: boolValue, key: id)
                }
                if let stringValue = value as? String {
                    self?.setValue(string: stringValue, key: id)
                }
            }
        }, weight: -1000), withName: bHookSettingsUpdated)
    }
  1. Actual result: Success run
  2. Comments: Please fix
bensmiley commented 3 years ago

For the time being, can you use this tag:

https://github.com/chat-sdk/chat-sdk-ios/releases/tag/5.0.1

I'll look at the issue with the main branch.

bensmiley commented 3 years ago

I can't reproduce this... can you download and test the default project?