Skip to content

Commit

Permalink
Update dependencies to react-native 0.71
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Feb 26, 2023
1 parent 0ccfb96 commit c22eb85
Show file tree
Hide file tree
Showing 46 changed files with 4,145 additions and 8,654 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ build/
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
Expand All @@ -64,3 +61,6 @@ dist/
# Ruby / CocoaPods
example/ios/Pods/
example/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ end
Add all wanted permissions to your app `android/app/src/main/AndroidManifest.xml` file:

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myawesomeapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- 🚨 Keep only the permissions used in your app 🚨 -->

Expand Down Expand Up @@ -984,15 +983,15 @@ Since iOS 15.0, it's impossible to request this permission if the app isn't `act
```js
useEffect(() => {
const callback = (status: AppStateStatus) => {
if (status === "active") {
if (status === 'active') {
request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY)
.then((result) => console.log(result))
.catch((error) => console.log(error));
}
};

callback(AppState.currentState); // initial call
const listener = AppState.addEventListener("change", callback);
const listener = AppState.addEventListener('change', callback);
return listener.remove;
}, []);
```
Expand Down
1 change: 1 addition & 0 deletions example/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
2 changes: 1 addition & 1 deletion example/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
2.7.6
40 changes: 9 additions & 31 deletions example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import {Platform, ScrollView, StatusBar, View} from 'react-native';
import {Appbar, Button, Divider, Snackbar, Text} from 'react-native-paper';
import RNPermissions, {NotificationOption, Permission, PERMISSIONS} from 'react-native-permissions';
import theme from './theme';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {SIRI, ...PERMISSIONS_IOS} = PERMISSIONS.IOS; // remove siri (certificate required)
Expand All @@ -27,11 +26,11 @@ export const App = () => {
const hideSnackbar = () => setSnackbarContent(undefined);

return (
<View style={{flex: 1, backgroundColor: theme.colors.background}}>
<StatusBar backgroundColor={theme.colors.primary} barStyle="light-content" />
<View style={{flex: 1}}>
<StatusBar barStyle="dark-content" />

<Appbar.Header>
<Appbar.Content title="react-native-permissions" subtitle="Example application" />
<Appbar.Content title="Permissions app" />

{Platform.OS === 'ios' && (
<Appbar.Action
Expand Down Expand Up @@ -74,23 +73,14 @@ export const App = () => {
return (
<React.Fragment key={item}>
<View style={{padding: 20}}>
<Text
numberOfLines={1}
style={{
color: 'rgba(0, 0, 0, 0.87)',
fontWeight: '400',
fontSize: 16,
textAlign: 'left',
}}
>
<Text numberOfLines={1} variant="bodyMedium">
{name}
</Text>

<View style={{flexDirection: 'row', marginTop: 12}}>
<Button
compact={true}
icon="eye-outline"
mode="outlined"
mode="contained"
onPress={() => {
RNPermissions.check(value)
.then((status) => {
Expand All @@ -107,9 +97,8 @@ export const App = () => {
<View style={{width: 8}} />

<Button
compact={true}
icon="help-circle-outline"
mode="outlined"
mode="contained"
onPress={() => {
RNPermissions.request(value)
.then((status) => {
Expand All @@ -131,23 +120,14 @@ export const App = () => {
})}

<View style={{padding: 20, paddingBottom: 32}}>
<Text
numberOfLines={1}
style={{
color: 'rgba(0, 0, 0, 0.87)',
fontWeight: '400',
fontSize: 16,
textAlign: 'left',
}}
>
<Text numberOfLines={1} variant="bodyMedium">
NOTIFICATIONS
</Text>

<View style={{flexDirection: 'row', marginTop: 12}}>
<Button
compact={true}
icon="eye-outline"
mode="outlined"
mode="contained"
onPress={() => {
RNPermissions.checkNotifications()
.then((response) => {
Expand All @@ -164,9 +144,8 @@ export const App = () => {
<View style={{width: 8}} />

<Button
compact={true}
icon="help-circle-outline"
mode="outlined"
mode="contained"
onPress={() => {
const options: NotificationOption[] = ['alert', 'badge', 'sound'];

Expand Down Expand Up @@ -195,7 +174,6 @@ export const App = () => {
duration={10000}
onDismiss={hideSnackbar}
action={{
color: '#607d8b',
label: 'Hide',
onPress: hideSnackbar,
}}
Expand Down
4 changes: 2 additions & 2 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'
ruby File.read(File.join(__dir__, '.ruby-version')).strip

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
22 changes: 0 additions & 22 deletions example/__test__/Permissions.test.js

This file was deleted.

55 changes: 0 additions & 55 deletions example/android/app/_BUCK

This file was deleted.

Loading

0 comments on commit c22eb85

Please sign in to comment.