bambuser / BambuserPlayerSDK-iOS

SDK of Bambusers live video shopping player for iOS
7 stars 2 forks source link

Firebase SDK crashing when trying to play a show #4

Closed joshgare closed 8 months ago

joshgare commented 8 months ago

We're trying to play a show in our app with the following code

let player = BambuserPlayerViewController(showId: "JVRtMWhgaIpb47qJKfkO") { playerEvent in
    self.handleBambuserPlayerEvent(playerEvent: playerEvent)
}
present(player, animated: true)

The player presents with a loading indicator but the app then subsequently crashes with the following error.

*** Terminating app due to uncaught exception 'FIRInvalidArgumentException', reason: 'Document path cannot be empty.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000018048d8a8 __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x000000018008409c objc_exception_throw + 56
    2   AppName                 0x0000000107ccc7f8 _ZN8firebase9firestore4util16ObjcThrowHandlerENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 112
    3   AppName                 0x0000000107ccc37c _ZN8firebase9firestore4util5ThrowENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 20
    4   AppName                 0x0000000107cd2234 _ZN8firebase9firestore4util20ThrowInvalidArgumentIJEEEvPKcDpRKT_ + 56
    5   AppName                 0x0000000107cd6c20 -[FIRCollectionReference documentWithPath:] + 288
    6   AppName                 0x00000001082d9f1c $s17BambuserPlayerSDK16FirestoreServiceC16listenBroadcasts14organizationId04showI0ySS_SStF + 252
    7   AppName                 0x00000001082370d0 $s17BambuserPlayerSDK0aB9ViewModelC6updateyyAA04ShowE0VF + 288
    8   AppName                 0x0000000108236a5c $s17BambuserPlayerSDK0aB9ViewModelC14setupFirestore4withyAA04ShowE0V_tYaKFTY0_ + 172
    9   AppName                 0x000000010824bb95 $s17BambuserPlayerSDK0aB9ViewModelC8loadShowyyFyyYaYbcfU_TQ9_ + 1
    10  AppName                 0x000000010825ff41 $s17BambuserPlayerSDK0aB9ViewModelC8loadShowyyFyyYaYbcfU_TATQ0_ + 1
    11  AppName                 0x000000010820e67d $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TQ0_ + 1
    12  AppName                 0x000000010825ffd5 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TA.135TQ0_ + 1
    13  libswift_Concurrency.dylib          0x00000001e2c399c5 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1
)
libc++abi: terminating due to uncaught exception of type NSException

Unfortunately this means the SDK is unusable.

saeidbasirnia commented 8 months ago

Hi @joshgare, Can you provide me with version of BambuserPlayerSDK you're using? Also are you facing this issue with all showIds? Please let me know while we look into this issue. Thanks

joshgare commented 8 months ago

@saeidbasirnia we've tried 1.2.2 and 1.3.0 and the crash occurs on both. We've tried 2 show ids and both caused the same crash.

saeidbasirnia commented 8 months ago

Thanks for the information. We'll look into this issue and I'll update this thread when we have more information.

saeidbasirnia commented 8 months ago

Hi @joshgare, We reviewed the issue and believe the issue is with the environment for the show. Default environment is global when not specified in the initializer, so you have to pass you're environment in init.

// If you're show is in an organization in EU
BambuserPlayerViewController(showId: "JVRtMWhgaIpb47qJKfkO", environment: .eu) 

You can check this out in our demo app. Please let me know if this resolved your issue!

Also a bug report is submitted for fixing the crash.

joshgare commented 8 months ago

Apologies, I didn't realise I had to specify environment. This is now working when the correct environment is used.

saeidbasirnia commented 8 months ago

That's great! thanks for the update. I'll close this issue now.

joshgare commented 8 months ago

@saeidbasirnia might be worth keeping open until crash is dealt with? Could have an error log instead of crashing the whole app?