Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo-Permissions Deprecated #220

Open
yumoraby opened this issue Aug 26, 2021 · 0 comments
Open

Expo-Permissions Deprecated #220

yumoraby opened this issue Aug 26, 2021 · 0 comments

Comments

@yumoraby
Copy link

Setup (always fill this in):

  • iOS or Android? Both
  • Expo or regular React Native? Expo
  • React Native Version:
  • expo-activity-feed 1.1.0

Describe the bug
expo-permissions has been removed from the latest expo release.

affected file: https://github.com/GetStream/react-native-activity-feed/blob/master/expo-package/src/index.js#L5

import { registerNativeHandlers } from 'react-native-activity-feed-core';
import * as Permissions from 'expo-permissions';
import * as ImagePicker from 'expo-image-picker';

registerNativeHandlers({
  pickImage: async ({ compressImageQuality = 0.2 }) => {
    try {
      const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
      if (status !== 'granted') {
        return {
          cancelled: true,
        };
      }

Resolution

import { registerNativeHandlers } from 'react-native-activity-feed-core';
import * as MediaLibrary from 'expo-media-library'
import * as ImagePicker from 'expo-image-picker';

registerNativeHandlers({
  pickImage: async ({ compressImageQuality = 0.2 }) => {
    try {
      const { status } = await MediaLibrary.requestPermissionsAsync(Permissions.CAMERA_ROLL);
      if (status !== 'granted') {
        return {
          cancelled: true,
        };
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant