code-matt / react-native-replaykit

A React Native module to access ReplayKit screen recording framework on iOS
13 stars 14 forks source link

fetchAllReplays fails #1

Closed progmatical closed 6 years ago

progmatical commented 6 years ago

When I call function RNRK.getRecordings(), my app fails.

Log in xCode says:

Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=260 "The file “Replays” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///var/mobile/Containers/Data/Application/BFA327EE-7AC3-48CD-98CB-2D393549E9D5/Documents//Replays, NSFilePath=/var/mobile/Containers/Data/Application/BFA327EE-7AC3-48CD-98CB-2D393549E9D5/Documents//Replays, NSUnderlyingError=0x2814e8cf0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

Any ideas please?

EDIT: It happens when I call this function right when the app is newly installed. There should be some improvement of that part. After making first video, the error never happens.

code-matt commented 6 years ago

Thanks! I moved the folder check to initialize where it should have been. New version out 1.0.7