Swift: Uploading image to Firebase cloud storage when user closes app

后端 未结 1 757
清酒与你
清酒与你 2021-01-21 01:57

How do I upload an image to Firebase Storage when the user terminates the app?

Here\'s my code:

firebaseRef.child(\"\\(uid)/\\(filePath)\").put(data, me         


        
相关标签:
1条回答
  • 2021-01-21 02:52

    Good question. At present, on iOS, there's no way of persisting and restarting the upload or download if the app is backgrounded or killed. This feature exists on Android (since the Activity is reset on screen rotation, making this a far more common issue), and we're planning on making it available on iOS in the future.

    Eventually, we want to simply make this a flag [FIRStorage enablePersistentUploads:YES] or similar, to automatically do this for you, so you don't have to think about it at all.

    0 讨论(0)
提交回复
热议问题