react-native-activity-feed icon indicating copy to clipboard operation
react-native-activity-feed copied to clipboard

Expo-Permissions Deprecated

Open yumoraby opened this issue 3 years ago • 0 comments

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,
        };
      }

yumoraby avatar Aug 26 '21 04:08 yumoraby