phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

Keys added using edit-config no longer included in Info.plist for iOS #615

Closed mesquaredinc closed 6 years ago

mesquaredinc commented 6 years ago

I use entries in config.xml for a number of purposes. They have worked perfectly since introduced in August 2017. However, sometime in the last few days they stopped working. Builds I created prior to December 12 work as expected.

Builds I and others create now do not work as expected, and upon inspection the Info.plist file does not contain the edits.

Here are some examples from config.xml.

  <edit-config target="UIRequiresFullScreen" file="*-Info.plist" mode="overwrite">
    <false/>
  </edit-config>

  <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>Used to attach photos to quotes and orders</string>
  </edit-config>

  <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>Used to attach photos to quotes and orders</string>
  </edit-config>

  <edit-config target="LSApplicationQueriesSchemes" file="*-Info.plist" mode="overwrite">
    <array>
      <string>ontop</string>
    </array>
  </edit-config>

Just to be clear again. nothing has changed in my config.xml recently. This has been working flawless for months. It just stopped working in the last day or two.

oleksiy-nesterov commented 6 years ago

same for me

ivbystrov commented 6 years ago

+1 same problem. It works on saturday but not work today

oleksiy-nesterov commented 6 years ago

Hi, can confirm that edit-config works only outside tag

mesquaredinc commented 6 years ago

My issue seems to be fixed. I built my apps this morning, no change to my config.xml, and everything is working again. Thank you to my mysterious benefactor!

@oleksiy-nesterov - what do you mean when you say "outside tag"?

ivbystrov commented 6 years ago

work again too I don't know how )))

vousys commented 6 years ago

With cli-7.1.0 :

    <plugin name="cordova-plugin-camera" >
          <variable name="CAMERA_USAGE_DESCRIPTION" value="To add pictures in  news, events, groups" />
          <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="To add pictures in  news, events, groups" />
    </plugin>

    <plugin name="cordova-plugin-ios-camera-permissions"   >
         <variable name="CAMERA_USAGE_DESCRIPTION" value="To add pictures in  news, events, groups" />
         <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="To add pictures in  news, events, groups" />
    </plugin>

 <platform name="ios">

         <edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
              <string>We need to know your location for carpooling</string>
         </edit-config>

         <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
              <string>Used to attach photos to your content</string>
         </edit-config>
         <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
              <string>Used to attach photos to your content</string>
         </edit-config>
    </platform>
LayZeeDK commented 6 years ago

My issue seems to be fixed. I built my apps this morning, no change to my config.xml, and everything is working again. Thank you to my mysterious benefactor!

@oleksiy-nesterov - what do you mean when you say "outside tag"?

It seems that <edit-config> tags do not work when wrapped in <platform> tags. Instead, use the platform attribute, i.e.

<edit-config platform="ios" target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
  <string>Used to attach photos to quotes and orders</string>
</edit-config>

I am using Cordova CLI 8.0.0.

andersborgabiro commented 6 years ago

I've been successful with wrapping edit-config in platform, but there's an overwrite issue (hopefully fixed) with PGB that might interfere.