Skip to content

Conversation

itsramiel
Copy link
Contributor

Summary

The expo config plugin edits:

  • AppDelegate
  • iOS infoPlist
  • AndroidManifest

The problem with the current plugin is that the values for the infoPlist are configurable, as in they do not support passing custom values instead of the dummy:

  • custom text shown in the Apple Health permission screen
  • custom text shown in the Apple Health permission screen
  • custom text shown in the Apple Health permission screen

While we can make the plugin accept arguments and dynamically use those, the better solution is let library users use existing expo tools to configure what already can be configured and only use the config plugin to configure those that can't be.

The change in this pr gets rid of the edits in:

  • iOS infoPlist
  • AndroidManifest

and only updates the AppDelegate.

The iOS infoPlist and AndroidManifest changes can be implemented by library users through the following config in app.json, 'app.config.(js/ts)':

Here is an example with app.config.(js/ts). If you do not need background syncs, then one can remove the related configs

{
    ios: {
      entitlements: {
        'com.apple.developer.healthkit': true,
        'com.apple.developer.healthkit.access': ['health-records'],
        'com.apple.developer.healthkit.background-delivery': true,
      },
      infoPlist: {
        UIBackgroundModes: ['fetch', 'processing'],
        NSHealthShareUsageDescription:
          'This app needs permission to share your health data',
        NSHealthUpdateUsageDescription:
          'This app needs permission to update your health data',
        NSHealthClinicalHealthRecordsShareUsageDescription:
          'This app needs permission to record your health data',
        BGTaskSchedulerPermittedIdentifiers: ['co.tryterra.data.post.request'],
      },
    },
    android: {
      intentFilters: [
        {
          action: 'androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE',
        },
        {
          action: 'android.intent.action.VIEW_PERMISSION_USAGE',
          category: 'android.intent.category.HEALTH_PERMISSIONS',
        },
      ],
    },
  }

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

Successfully merging this pull request may close these issues.

1 participant