React Native Tech Blog

supported by maricuru (旧maricuru tech blogです)

【React Native】【Expo】iOSのパーミッション要求ダイアログで審査リジェクトされた話とその対応

Qiitaに書けや!ってレベルの小ネタも書いていきますよ〜w

弊社のアプリはReact Native + Expoで開発していますが、先日のiOSストア申請でリジェクトされたときのお話と、その対応です。

こんな理由でリジェクトが

Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage
We noticed that your app requests the user’s consent to access their photos but does not clarify the use of this feature in the permission modal alert.

Next Steps
To resolve this issue, please revise the permission modal alert to specify why the app is requesting access to the user's photos.
The permission request alert should specify how your app will use this feature to help users understand why your app is requesting access to their personal data.

この画面です。
カメラロールのパーミッションを要求するときに「何のために使うのか?」の理由を書くように、とのことです。

f:id:wasan:20180726112607p:plain:w500

Expoでの対応方法

リジェクトされたときのダイアログはExpoデフォルトのものを表示していました。

await Permissions.askAsync(Permissions.CAMERA_ROLL);

これでパーミッション要求のダイアログが表示されるのですが、今回の改修ではそのダイアログのテキストをカスタマイズしたいです。

テキストをカスタマイズするにはapp.jsonを変更します。 以下のような感じでNSPhotoLibraryUsageDescriptionに表示したいテキストを記載すればOKです。

{
  "expo": {
    "name": "hogeapp",
    (中略)
    "ios": {
      "bundleIdentifier": "com.hogeapp",
      "buildNumber": "1",
      "infoPlist": {
        "NSPhotoLibraryUsageDescription": "This app access your photo gallery to share your photos in this app."
      }
    }

}

テキストが変わりました🎉

f:id:wasan:20180726134058j:plain:w300

参考

Permissions - Expo Documentation

Deploying to App Stores - Expo Documentation