The TikTok OpenSDK features Login Kit and Share Kit which allow your users to log in using their TikTok account and share content from your app to TikTok.
I was having an issue where my completion handler was never being called. After some debugging, I noticed that by the time my app delegate's handler was being called, the "requests" NSMapTable in TikTokAPI was empty, thus it never handled responses.
I managed to fix this problem by changing the following line:
private static var requests: NSMapTable<NSString, TikTokBaseRequest> = NSMapTable.strongToWeakObjects()
to the following:
private static var requests: NSMapTable<NSString, TikTokBaseRequest> = NSMapTable.strongToStrongObjects()
I understand this might be difficult to reproduce, but it happened 100% of the times while testing on my iPhone Xr with OS 15.6.1.
hi there!
I was having an issue where my completion handler was never being called. After some debugging, I noticed that by the time my app delegate's handler was being called, the "requests" NSMapTable in TikTokAPI was empty, thus it never handled responses.
I managed to fix this problem by changing the following line:
private static var requests: NSMapTable<NSString, TikTokBaseRequest> = NSMapTable.strongToWeakObjects()
to the following:
private static var requests: NSMapTable<NSString, TikTokBaseRequest> = NSMapTable.strongToStrongObjects()
I understand this might be difficult to reproduce, but it happened 100% of the times while testing on my iPhone Xr with OS 15.6.1.