mikehardy / react-native-update-apk

Update apk from non-play store servers, and update ios from app store in React Native.
MIT License
193 stars 57 forks source link

Added headers param to download the new APK file. #34

Closed rejunges closed 4 years ago

rejunges commented 4 years ago

Added apkHeaders to UpdateAPK options. This param is optional and it is an object of headers to be passed to the server to download the new APK.

I tested this sending the apkHeaders (authorization) when the user needed to be autenticated and without the apkHeaders when the headers were not necessary.

rejunges commented 4 years ago

Thanks for bending the PR just a bit, I think it will feel a bit more coherent to future developers to have both of the network requests use the same style for overrides even though one is fetch and one is RNFS beneath the API

Same as last time - you test this and it's all working for you in your project if you supply the new arguments or not? I'll approve this now but I'll wait for merge+release until I you confirm

Cheers

I tested in my project and I added the statusCode confirmation because when the user is unauthorized the system sended statusCode 403 and this generated some problems. Now, it is fixed. I also tested a lot the apkOptions to make sure everything is fine.

Cheers!

mikehardy commented 4 years ago

released! v4.5.0 is out https://github.com/mikehardy/react-native-update-apk/releases/tag/v4.5.0

I don't need this in my projects so would not have thought of it, but I can immediately see how this can allow more control and also security etc. Powerful additions for such contained + easy to review PRs, thanks