Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12009

<resource-file> target attribute ignored on iOS when installing a Cordova plugin

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 6.3.0, 6.3.1
    • Fix Version/s: cordova-ios@4.4.0
    • Component/s: cordova-ios
    • Labels:
      None

      Description

      In the Cordova plugin.xml documentation it is stated that the <resource-file> tag can have an attribute target. See next link: https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#resource-file

      But when I try to use this target attribute it is just ignored and all <resource-file> configurations are added to the Resources directory on iOS.
      It seems to me that the cordova-lib code just ignores this target attribute, see next link: https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/plugman/platforms/ios.js#L165

      The code grabbed from that link:
      destFile = path.resolve(project.resources_dir, path.basename(src));

      Here you can see the destFile is hardcoded for the resources_dir.
      We are trying to add push notification sounds to the iOS Resources directory as well as adding it to either the bundle root or Library/Sounds. Because we have seen that since iOS 10 we need to put the sounds files elsewhere then the Resources directory to get it work. See: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shazron Shazron Abdullah
                Reporter:
                markdark81 Mark Veenstra
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: