# If ios sdk use "method swizzling" to hook system method?

**URL:** <https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014>\
**Category:** Meeting SDK\
**Created:** [January 18, 2019, 6:28am UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014 "2019-01-18T06:28:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![guan\_bj](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@guan\_bj](https://devforum.zoom.us/u/guan_bj)\
**Post date:** [January 18, 2019, 6:28am UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/1 "2019-01-18T06:28:25Z")

</div>

my app integrates other sdk to play animation, during the playing I will get the finish callback and tell app which one is complete, then app will start to play next one. before integrate zoom sdk the playing works well.  
after integrate zoom sdk even never join any meeting, just package it into app. the play complete callback always return 0. so my app can’t play next one correctly. and **this issue only existing in ios 9.0 OS.**  
I guess zoom sdk hook some system status.

[demo project](https://sy-tools.oss-cn-beijing.aliyuncs.com/AnimationDemo.zip)

[play without zoom sdk](https://sy-tools.oss-cn-beijing.aliyuncs.com/play_normal.mp4)  
[play with zoom sdk](https://sy-tools.oss-cn-beijing.aliyuncs.com/play_error.mp4)

this is no zoom sdk debug snapshot:

 ![normal_debug](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/1X/b5354d7e206fde2d15c50ce8cdc91d171b2fe7e6.jpeg)

this is with zoom sdk debug snapshot:

 ![error_debug](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/1X/4e95b092d17284f3ffc907cfe1da0dfed08bb97d.jpeg)

---

<div class="post-metadata">

**Author:** ![jackie.chen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackie.chen/32/19282_2.png) [@jackie.chen](https://devforum.zoom.us/u/jackie.chen)\
**Post date:** [January 18, 2019, 8:12am UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/2 "2019-01-18T08:12:59Z")

</div>

![1](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/1X/2fae7e406705ae4332a3ed04a349424ddb6c928a.jpeg)

Hi Guan,

I just download the Demo, and run it in iOS 9.0 simulator. Seems ok in my side.  
Are you run in device? I don’t have device with iOS 9.0 right now.  
And after check the code, we don’t found that special system event hook.

Regards!

---

<div class="post-metadata">

**Author:** ![guan\_bj](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@guan\_bj](https://devforum.zoom.us/u/guan_bj)\
**Post date:** [January 18, 2019, 12:31pm UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/3 "2019-01-18T12:31:09Z")

</div>

Yes, we run on ios 9.0 device.

---

<div class="post-metadata">

**Author:** ![guan\_bj](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@guan\_bj](https://devforum.zoom.us/u/guan_bj)\
**Post date:** [January 18, 2019, 2:47pm UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/4 "2019-01-18T14:47:49Z")

</div>

![12%20PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/1X/2b70512a84c9f17a7d9b49d921ce4b95a30120e6.png)

jackie.chen  
thanks your help, I guess you can understand Chinese. can you help me to confirm what doubt code in your framework load function?

---

<div class="post-metadata">

**Author:** ![jackie.chen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackie.chen/32/19282_2.png) [@jackie.chen](https://devforum.zoom.us/u/jackie.chen)\
**Post date:** [January 21, 2019, 8:09am UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/5 "2019-01-21T08:09:26Z")

</div>

Hi Guan,  
I don’t get the point, the framework load in this project only load the code to memory. Not running any code in that moment. Why could effect the the main project code?  
And for this issue, could you try change the key in this line “[group setValue:@“WCRDiamondAnimationObject” forKey:@“animationID”]”, just for a test.

Regards!

---

<div class="post-metadata">

**Author:** ![jackie.chen](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackie.chen/32/19282_2.png) [@jackie.chen](https://devforum.zoom.us/u/jackie.chen)\
**Post date:** [January 21, 2019, 8:43am UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/6 "2019-01-21T08:43:24Z")

</div>

Hi Guan,  
You can check the object address before animation start and the start callback.

 ![2](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/1X/6b548966ad17cd3479f08b79efeb3a823e75427f.jpeg)  
I guess the object maybe not same when that phenomenon observed.

Regards!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:09pm UTC](https://devforum.zoom.us/t/if-ios-sdk-use-method-swizzling-to-hook-system-method/3014/7 "2020-08-21T18:09:11Z")

</div>

Closed on August 21, 2020, 6:09pm UTC


