Giter VIP home page Giter VIP logo

rn-photos-framework's Introduction

Forked repo

!!! Fork from original https://github.com/olofd/react-native-photos-framework repo

Warning

In latest IOS versions (13.4+) the library acts strange if @react-native-community/cameraroll is linked

Use at your own risk!

Works on

RN 0.60+

Updated instructions:

npm i --save rn-photos-framework

Automatic:

react-native link rn-photos-framework and remove Android linking afterwards

Manual: Add to your Podfile in ios/Podfile:

pod 'rn-photos-framework', :path => '../node_modules/rn-photos-framework'

Import

import RNPhotosFramework from 'rn-photos-framework';

Original documentation and examples: Guide

PR's are welcome

rn-photos-framework's People

Contributors

adbl avatar gre avatar justinsherwood avatar olofd avatar ralfnieuwenhuizen avatar rossmartin avatar samueljmurray avatar sjmueller avatar thymikee avatar vforvasile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rn-photos-framework's Issues

null is not an object (evaluating 'RNPFManager.requestAuthorization')

Hello,
I am trying to use this library but when importing it and trying to use it I am getting this error: null is not an object (evaluating 'RNPFManager.requestAuthorization')
This is for an android app built with react native
I installed the library using: npm install rn-photos-framework

the code in which i am using it is:

import React, {useEffect} from 'react';
import {View, Text} from 'react-native';
import RNPhotosFramework from 'rn-photos-framework';
export default function AlbumsScreen() {

useEffect(() => {
RNPhotosFramework.requestAuthorization()
}, []);
return (
//
// Albums Screen
//
);
}

the dependencies i am using are:

"dependencies": {
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/native": "^5.6.1",
"@react-navigation/stack": "^5.6.2",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.0.7",
"react-native-screens": "^2.9.0",
"react-native-vector-icons": "^7.0.0",
"rn-photos-framework": "^1.0.7"
},

tried uninstalling it then reinstalling but didn't work
tried linking it but also didn't work
please help me with this issue

thank you for your time

Conflict with @react-native-community/cameraroll

Hi!

About this warning:

In latest IOS versions (13.4+) the library acts strange if @react-native-community/cameraroll is linked
Use at your own risk!

What exactly is meant by that? Do you know what causes this?

I have cameraroll and this package linked on my project and there is conflict with PHAssetCollectionSubtype since both use it with RCT_ENUM_CONVERTER.

See: https://github.com/react-native-cameraroll/react-native-cameraroll/blob/39cc3b0fbc60530290ca88b5a7558c23cd1520bc/ios/RNCCameraRollManager.m#L27-L37

So I managed to get rid of that error by adding

typedef NS_ENUM(NSInteger, PHAssetFrameworkCollectionSubtype);

to RCTConvert+RNPhotosFramework.h.

And replaced all references to PHAssetCollectionSubtype with PHAssetFrameworkCollectionSubtype. It now has no error and everything seems to work fine.

Since I'm not familiar with objective-c, I'm not sure if this is correct nor best way to achieve this.

Maybe you can guide me? I would like to submit PR if I know I'm doing it correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.