olofd / react-native-photos-framework

A modern and comprehensive CameraRoll/iCloud-library-API for React Native 📸 📹
MIT License
220 stars 99 forks source link

Check selectors not supported in iOS 8 #29

Closed adbl closed 7 years ago

adbl commented 7 years ago

We can see this crash for iOS 8.4 both on device and in simulator:

Exception name=RCTFatalException: 
Exception '-[PHFetchOptions setIncludeAssetSourceTypes:]: unrecognized selector sent to instance 0x1702c08c0' was thrown while invoking getAssets on target 
CameraRollRNPhotosFrameworkManager with params (...
) ...

This PR checks that two specific selectors that we saw crashes for are available, in iOS 8 that will no be the case. I manually tested that the sourceType option still works in iOS 10 Simulator.

I'm not exactly sure what the implications of this option not supported in iOS 8 are. 8.4 Simulator Photos / Settings app crashed when I tried to enable iCloud photo library (probably because the apple id has been used with later iOS versions), so I could not test that. At least it isn't crashing anymore and we could get the standard Simulator photos + manually added ones via the library.

olofd commented 7 years ago

Great work! I have not tested at all actually on iOS 8, so please let me know if there are anything else that need to be looked at!