LoginSignup
0
0

More than 1 year has passed since last update.

パーミッション権限の設定方法について

Last updated at Posted at 2023-04-13

【背景】
システム制作において、権限の設定をする業務を任された。

【必要な権限】
・カメラ
・push通知
・ストレージ
・広告トラッキング

【一旦関連リンクまとめ】
設定方法は以下のリンクにまとまっている

(android)
・カメラ
https://qiita.com/SallyCinnamon/items/4e793bdcb70df2c21813
・push通知
https://zenn.dev/nekoniki/scraps/fd21c393af733c
・ストレージ
https://techgrowup.net/2021/05/14/permission/
・広告トラッキング
https://qiita.com/kokogento/items/eb53b68da8a42e7a4266

(ios)
・カメラ
https://qiita.com/SallyCinnamon/items/4e793bdcb70df2c21813
・push通知
https://zenn.dev/chocoyama/articles/5b07eead5ae0aa
https://repro.io/contents/ios-remote-push-notifications-in-a-nutshell/
・ストレージ
https://majintools.com/2018/11/05/photo/
・広告トラッキング
https://zenn.dev/yorifuji/articles/ios-app-tracking-transparency

【権限の設定ファイル】
ios・・・info.plist
android・・・AndroidManifest.xml

【使用ライブラリ】
react-native-permissions
https://qiita.com/SallyCinnamon/items/4e793bdcb70df2c21813

【エラー対応】
・バージョンは3.8.0を使用しますが、エラーが出るので、以下対応
https://github.com/facebook/react-native/issues/34106
↓↓
iOS フォルダーで、Pods/Pods.xcodeproj/xcuserdata/project.pbxproj に移動します。

すべての「IPHONEOS_DEPLOYMENT_TARGET = 11.0」を「IPHONEOS_DEPLOYMENT_TARGET = 12.4」に変更します。保存して実行します。
↑↑

・起動できない
https://stackoverflow.com/questions/61980130/console-error-no-permission-handler-detected-react-native

↓↓
permissions_path = '../node_modules/react-native-permissions/ios'

pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"
↑↑

iosは上記で上手くいくが、androidは上手くいかなかった。(ad_idがライブラリにないため)
以下によりandroidは実施
https://reactnative.dev/docs/permissionsandroid

※広告IDは、googleのplay consoleで検討する予定。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0