앱 설정

기업용으로 설계된 일부 앱에는 IT 관리자가 원격으로 구성할 수 있는 관리 구성이라는 기본 제공 설정이 포함되어 있습니다. 예를 들어 앱에서 기기가 Wi-Fi에 연결된 경우에만 데이터를 동기화하는 옵션이 있을 수 있습니다. IT 관리자에게 관리 구성을 지정하고 이를 기기에 적용할 수 있는 기능을 제공하는 것은 모든 솔루션 세트의 요구사항입니다.

아래 다이어그램은 Google Play EMM API를 통해 사용할 수 있는 옵션의 개요를 통해 관리 구성 관리의 주요 단계를 보여줍니다.

앱이 관리 구성을 지원하는지 확인

Products.getAppRestrictionsSchema를 사용하여 앱에서 관리 구성을 지원하는지 확인합니다. 다음은 Java용 Google Play EMM API 클라이언트 라이브러리를 사용하는 예입니다.

public AppRestrictionsSchema getAppRestrictionsSchema(String enterpriseId,
    String productId, String language) throws IOException {
  return androidEnterprise
     .product()
     .getAppRestrictionsSchema(enterpriseId, productId, language)
     .execute();
}

모든 앱은 앱 제한 (관리 구성) 스키마를 반환합니다. 호출이 빈 스키마를 반환하면 앱은 구성 관리를 지원하지 않습니다. 호출로 인해 일련의 제한사항이 포함된 스키마가 반환되면 앱은 관리 구성을 지원합니다. 예를 들어 VPN을 통한 원격 인쇄를 사용 설정하는 속성이 있는 앱은 Products.getAppRestrictionsSchema에 다음 응답을 반환할 수 있습니다.

    {
      "kind": "androidenterprise#appRestrictionsSchema",
      "restrictions": [
        {
          "key": "printing_enabled",
          "title": "Enable printing",
          "restrictionType": "bool",
          "description": "Allow user to print from the app",
          "defaultValue": {
            "type": "bool",
            "valueBool": true,
          }
        },
        {
          "key": "vpn_configurations",
          "title": "VPN configurations",
          "restrictionType": "bundle_array",
          "description": "List of VPN configurations",
          "nestedRestriction": [
            {
              "key": "vpn_configuration",
              "title": "VPN configuration",
              "restrictionType": "bundle",
              "nestedRestrictions": [
                {
                  "key": "server",
                  "title": "VPN server host",
                  "restrictionType": "string"
                },
                {
                  "key": "username",
                  "title": "VPN account username",
                  "restrictionType": "string"
                }
              ]
            }
          ]
        }
      ]
    }

관리 구성 지정

관리 구성을 지원하는 앱의 경우 IT 관리자가 관리 구성 iframe을 삽입하거나 자체 UI를 개발하여 EMM 콘솔에서 이를 설정하도록 할 수 있습니다.

옵션 1: 관리 구성 iframe 삽입

관리 구성을 지원하는 가장 쉬운 방법은 관리 구성 iframe을 EMM 콘솔에 삽입하는 것입니다. iframe은 지정된 앱의 관리 구성 스키마를 가져오고 IT 관리자가 맞춤 구성 프로필을 저장, 수정, 삭제하도록 허용합니다. Play EMM API를 사용하여 사용자 기기에 맞춤 프로필을 적용할 수 있습니다. iframe과 이를 콘솔에 추가하는 방법에 관한 자세한 내용은 관리 구성 iframe을 참고하세요.

옵션 2: 자체 UI 만들기

Products.getAppRestrictionsSchema에서 반환된 구성을 사용하여 IT 관리자가 앱 구성을 관리할 수 있는 자체 UI를 만들 수 있습니다.

관리 구성 적용

관리 구성을 기기에 적용하려면 기기 정책 컨트롤러 빌드에 설명된 대로 DPC를 DPC 지원 라이브러리와 통합해야 합니다. DPC 지원 라이브러리는 관리 구성을 적용하기 위해 Google Play에 대한 위임을 투명하게 처리합니다.

Devicepolicy에서 policy.productPolicy.managedConfiguration를 설정하여 관리 구성을 기기에 적용할 수 있습니다.

mcmId 사용

IT 관리자가 관리 구성 iframe에서 새 구성 프로필을 저장할 때마다 iframe은 mcmId라는 고유 식별자를 반환합니다. mcmId에는 적용할 수 있는 기기 수에 제한이 없고 만료 시간도 없습니다.

구성 프로필을 기기에 적용하려면 Devicepolicy에서 policy.productPolicy.managedConfiguration.configurationVariables.mcmId를 설정합니다.

IT 관리자가 관리 구성 iframe에서 변수를 사용하도록 하려면 (예: $FirstName, $LastName) policy.productPolicy[].managedConfiguration.configurationVariables.mcmId.variableSet[]를 사용하여 프로필에 포함된 변수를 정의해야 합니다.

관리 속성 목록 사용

Devicepolicy에서 policy.productPolicy.managedConfiguration.managedProperty[]를 설정하여 관리 속성 집합을 포함할 수도 있습니다.

아래 예는 구성을 정의하는 방법을 보여줍니다. 이 구성에는 두 개의 번들 속성 (관련 속성 그룹. 이 경우 VPN 속성)으로 구성된 bundle_array (목록)가 포함됩니다.

    ManagedConfiguration managedConfiguration = new ManagedConfiguration()
      .setManagedProperty(
        ImmutableList.of(
            new ManagedProperty()
                .setKey("printing_enabled")
                .setValueBool(true),
            new ManagedProperty()
                .setKey("vpn_configurations")
                .setValueBundleArray(
                    ImmutableList.of(
                        new ManagedPropertyBundle().setManagedProperty(
                            ImmutableList.of(
                                new ManagedProperty()
                                    .setKey("server")
                                    .setValueString("vpn1.example.com"),
                                new ManagedProperty()
                                    .setKey("username")
                                    .setValueString("john.doe"))),
                        new ManagedPropertyBundle().setManagedProperty(
                            ImmutableList.of(
                                new ManagedProperty()
                                    .setKey("server")
                                    .setValueString("vpn2.example.com"),
                                new ManagedProperty()
                                    .setKey("username")
                                    .setValueString("jane.doe")))))));

앱이 지원할 수 있는 다양한 구성 속성에 관한 자세한 내용은 관리 구성 정의를 참고하세요.

앱의 구성 프로필 나열

솔루션을 설계하는 방법에 따라 앱에 저장된 구성 프로필 목록을 표시해야 할 수 있습니다. 이 목록을 검색하려면 Managedconfigurationssettings.list를 호출합니다.